making username clickable in events manager


I need to make the profile picture of those users who will attend my event to be clickable. you can see this below picture to know what I am talking about.

tes

and this is the URL of the said event.

so how to make the profile picture clickable for attendee list of an event?

the answer is by using this code below

/*
 This custom template will make the username link to buddypress profile page using placeholder #_ATTENDEELIST
Instructions:
1. Create these folders inside your current theme directory plugins/events-manager/placeholders
   eg. wp-content/themes/Your Theme/plugins/events-manager/placeholders
2. Inside the above custom directory, create new php file attendeeslist.php
   eg. wp-content/themes/Your Theme/plugins/events-manager/placeholders/attendeeslist.php
3. edit attendeeslist.php and paste the below snippet
4. use placeholder #_ATTENDEESLIST in your formatting options at Events > Settings > Formatting > Events
 */
<?php /* @var $EM_Event EM_Event */ $people = array(); $EM_Bookings = $EM_Event->get_bookings();
if( count($EM_Bookings->bookings) > 0 ){
        ?>
        
<ul class="event-attendees">
        <?php $guest_bookings = get_option('dbem_bookings_registration_disable'); $guest_booking_user = get_option('dbem_bookings_registration_user'); foreach( $EM_Bookings as $EM_Booking){ if($EM_Booking->booking_status == 1 && !in_array($EM_Booking->get_person()->ID, $people) ){
                        $people[] = $EM_Booking->get_person()->ID;
                        echo '
<li>'.bp_core_get_userlink($EM_Booking->get_person()->ID).'</li>

';
                }elseif($EM_Booking->booking_status == 1 && $guest_bookings && $EM_Booking->get_person()->ID == $guest_booking_user ){  
                        echo '
<li>'.bp_core_get_userlink($EM_Booking->get_person()->ID).'</li>

';
                }
        }
        ?>
        </ul>

        <?php
}

you can see many more custom code for events manager plugin in this link

How to know what day from a date?


I am gonna teach you how to know what day it is based on a certain given date with its month. first, you need to look at below table.

Month Day
January Saturday
February Monday
March Tuesday
April Tuesday
May Sunday
June Wednesday
July Friday
August Monday
September Thursday
October Saturday
November Tuesday
December Thursday

so here’s how it works

For any given month, all the multiples of 7 fall on the same day. I usually have memorized what day that is for the current month and the next few months. So October is a “Saturday month” and November is a “Tuesday month” and December is a “Thursday month”. You only have to memorize a new one every month.

Now when somebody says, “We should get together one Saturday. Say… December 12.” you can snap back with “That’s a Tuesday. Do you mean December 9?” All you have to do is find the nearest multiple of 7 and work from there. So when they ask about December 12, that’s close to December 14 – which must be a Thursday (since December 2016 is a Thursday month).

that’s mean you need to look at the table that I’ve just made you above and use the theory from Lifehacker to find out what day it is based on the given date and month.

let’s say we’re trying to find out what day it is during 17 August which is the independence day in Indonesia. since August is a Monday month then the 14th would be Monday and 17th would be Thursday. Hence Indonesia will have independence day on a Thursday. Pretty useful if you need to know the day of the week in the coming month. but for days that are much more farther then just use google to find out.

Silicon valley


Silicon Valley newest episode of 3 really enlightened me to enormous problems that befall a startup. that is why you should be able to understand the law of the land. Such as reading the terms of service, TOS as it called provide a legal ground when you are getting sued over something. By writing about the aspects of your business and the scope of customer you’d want to achieve then TOS can be a lifesaver when you hit the legal problem. Although in Indonesia, there isn’t really such a things as a legal problem for IT company here since there isn’t that many of it. But by hiring a lawyer and studying the current law then you’ll be able to run stuff smoothly.

There are also many great jokes in silicon valley that will make you understand how to deal with programmers. The programmer doesn’t have feelings, they talk like a robot and don’t socialize that much.

email hosting


when you run a business then it is very important to own a custom domain associated with your company and also have email that has a custom address so as to add business credence and proffesionalism to your marketing. and this is why email hosting comes into play.

there are 2 ways to send email, by using email provider like google apps, zoho mail and others or you can just get a server and install email software like zimbra in the server. although the latter requires you to have a sysadmin that will have to standby 24/7 in managing the email server. because if you don’t monitor the server then you might miss those important email from your client and this can be troublesome.

if you used email hosting from shared IP then there is a higher degree that your email IP address might get blacklisted due to spam. and hence will get blocked when you send the email to your client’s email address. so my advice is to use trusted email hosting like google apps or zoho. I had used both of this service and they are just good. although google apps gives you much more functionalities and ask you to pay first to use it.

no matter what, email is still an important tools in delivering messages across business partners and that’s why you should invest money in using better email hosting.

 

RSS feed error


I created a planet feed then there is something wrong with its RSS feed that prevent me from posting the feed in my twitter account. below is the error

This page contains the following errors:

error on line 357 at column 40: xmlParseEntityRef: no name
Below is a rendering of the page up to the first error.

turns out the cause of the error is because one of the blogs that I aggregated into has a post title with (&) ampersand. now this ampersand symbol would be allright if it was put into a post body but if you put it into a post title then the above error would come up.

it’s a bit silly that a single ampersand could have fail the whole RSS feed in planetplanet. so yeah I hope you will not put ampersand in the title of your blog posting and just put it in the post body instead.

 

using ubuntu


I had to go back to using ubuntu again in my computer desktop as my windows had been acting up. the problem started when my old graphics card died and I had to use the new one and the problem was that this new graphic card that is GT630 has a problem with its driver so when I installed the driver in windows 7 or windows XP, it just won’t work and the display is just worsened and not very smooth. even in windows 7 the screen always shows blue screen of death everytime I installed the drivers.

so yeah, in conclusion I had to let go of everything windows and now use ubuntu and as it turns out ubuntu can handle this graphic cards really well and the display is smooth and stable. I just need to learn all the command line and install necessary software for making my experience with ubuntu a lot better. beside I am also planning to use VPS in the coming days so having ubuntu will smoother the experience in managing a server as I need to adapt in using command line.

 

 

indexes in programming


have you ever wonder why indexes always start at  0 but not at 1 ?

animals = ['bear', 'tiger', 'penguin', 'zebra']
bear = animals[0]
tiger = animals[1]

You take a list of animals, and then you get the first (1st) one using 0?! How does that work? Because of the way math works, Python and other progamming languages starts its lists at 0 rather than 1.

The best way to explain why this is happening is by showing you the difference between how you use numbers and how programmers use numbers.

Imagine you are watching the four animals in our list (['bear', 'tiger', 'penguin', 'zebra']) run in a race. They cross the finish line in the order we have them in this list. The race was really exciting because the animals didn’t eat each other and somehow managed to run a race. Your friend shows up late and wants to know who won. Does your friend say, “Hey, who came in zeroth?” No, he says, “Hey, who came in first?”

This is because the order of the animals is important. You can’t have the second animal without the first (1st) animal, and you can’t have the third without the second. It’s also impossible to have a “zeroth” animal since zero means nothing. How can you have a nothing win a race? It just doesn’t make sense. We call these kinds of numbers “ordinal” numbers, because they indicate an ordering of things.

Programmers, however, can’t think this way because they can pick any element out of a list at any point. To programmers, the list of animals is more like a deck of cards. If they want the tiger, they grab it. If they want the zebra, they can take it too. This need to pull elements out of lists at random means that they need a way to indicate elements consistently by an address, or an “index,” and the best way to do that is to start the indices at 0. Trust me on this: the math is way easier for these kinds of accesses. This kind of number is a “cardinal” number and means you can pick at random, so there needs to be a 0 element.

Remember: ordinal == ordered, 1st; cardinal == cards at random, 0.

unblock blocked website


the problem was that since telkom blocked reddit, netflix and god-knows-what-else-did-they-blocked. I need to find a way to circumvent this issues head on. turns out that telkom only blocked the keywords but not the ip address of the server’s website so when you open netflix.com then you’d get into a page of internetpositif which is basically telkom way of telling you that you can’t open this website.

one way to bypass this is to put this line of code in your ‘/etc/hosts’. and if you use windows then you can open the file in C:\Windows\System32\drivers\etc and input the following line using text editor.

127.0.0.1       localhost
::1             localhost
127.0.0.1 cfs.u-ad.info
127.0.0.1 adscenter.u-ad.info
127.0.0.1 u-ad.info
127.0.0.1 cfs2.uzone.id

198.41.209.141 reddit.com
198.41.209.141 www.reddit.com
75.101.139.66 netflix.com
75.101.139.66 www.netflix.com

there you have it, so everytime you encountered blocked website then you should just find the server ip address and put the ip address in hosts file and update it and you can open the blocked website without the need to use vpn.

simple solution for censorship.

MDDHosting


if you read my previous post, then you should know that I host my site at namecheap, while my experience in namecheap is good as they had great promise in server uptime. I also want to try some other host so as to experience what it’s like. you know the phrase “don’t put your eggs in one basket”, and this principle is also why this blog is hosted at wordpress.com and not at my hosting. as wordpress.com is much more reliable in blogging and lasts forever.

so when I visited MDDhosting, I was surprised that they initiate the chat eventhough I am not logging in, it must be they had installed some kind of chat function. so here’s how the chat went down.

Details:
     Date: 6/25/2016 12:33:36 PM
     Operator: No operator
     Initial Page: https://www.mddhosting.com/hosting.php
     Referer: https://www.facebook.com/
     Rating: No Rating
     Phone Number:
     Email: 

[6/25/2016 12:33:36 PM] Visitor joined the chat

[6/25/2016 12:33:36 PM] Michael Denney joined the chat

[6/25/2016 12:33:43 PM] Michael Denney said:
Hello! I'm here to help if you have any questions or need any assistance.

[6/25/2016 12:35:41 PM] Visitor said:
well I am from indonesia and from what I read you don't support indonesia user right?

[6/25/2016 12:36:25 PM] Michael Denney said:
We have seen high levels of fraud from Indonesia so we would likely verify your order.

[6/25/2016 12:37:09 PM] Michael Denney said:
That said we do accept orders and customers from Indonesia. 

[6/25/2016 12:37:26 PM] Visitor said:
verify by using my passport?

[6/25/2016 12:38:27 PM] Michael Denney said:
You could. Or if paying via a credit card just show us the front and cover the middle 8 numbers so we can be sure you have it in your possession. Or pay via PayPal and use the same email address to sign up as your PayPal account. 

[6/25/2016 12:38:53 PM] Michael Denney said:
We don't want your credit card or PayPal account to be used without your permission. đŸ˜‰

[6/25/2016 12:39:01 PM] Visitor said:
I understand

[6/25/2016 12:39:15 PM] Michael Denney said:
Is there anything else I can assist you with today?

[6/25/2016 12:39:32 PM] Visitor said:
no thanks. I got what I need.

[6/25/2016 12:39:37 PM] Michael Denney said:
Thank you for using the MDDHosting Live chat!  Have a wonderful day.

[6/25/2016 12:39:41 PM] Michael Denney left the chat

[6/25/2016 12:39:41 PM] Visitor left the chat

based on the review that I read in forum, mddhosting seems to have many great impression but they do make it harder for people from indonesia to register. I mean in namecheap, I had to used other’s people paypal account to pay for the invoice due to my paypal is still not verified because of the credit card issue.

so in conclusion, for great hosting then yeah namecheap is still the best for me. suitable for web developers to build application.

what is Sass?


Sass, or Syntactically Awesome StyleSheets, is an extension language for CSS. With Sass, you can write clean, sustainable CSS code and solve the common repetition and maintenance challenges present in traditional CSS.

to see Sass example then just go here

In addition to being a valuable skill for any front-end developer, transitioning from CSS to Sass is pretty smooth due to the familiar syntax. Sass can’t be directly interpreted by your browser, so it must first be converted, or compiled, to CSS before the browser can directly understand it. and you can use this link to do just that.

Compiling refers to converting code to lower level code so that it can be executed. By compiling SCSS to CSS, it can be interpreted by your browser and the results will appear on a webpage.

this is only introduction, for more complex example will be presented in another post.