Programing, wordpress

Modify length of word in the_excerpt function wordpress

Default length of words in the_excerpt function wordpress is 55 words . How to modify it ? when you think it is too long or you want more words to display it ?

– Adding this function in wp-includes/formatting.php

function string_limit_words($string, $word_limit)
{
$words = explode(‘ ‘, $string, ($word_limit + 1));
if(count($words) > $word_limit)
array_pop($words);
return implode(‘ ‘, $words);
}

– add this line in templates page that you want to display the_excerpt

<?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt, n); ?>

: number of word that you want to display .

Standard
Programing

Installing Package in Sublime Text

Sublime text is one of my favorite IDE. After entering license a week ago , i will share here how to installing package in sublime text.

  1. select Preferences > Browse Package
  2. see the location of package that your sublime text installed
  3. download package control for sublime and put in package directory
  4. Restart sublime

For Installing package :

  1. press Ctrl ( command ) + Shift + P . type Package Controll : Install Package
  2. scroll down , choose what type of package that you want to install . ex : html5
  3. wait until installation process done.

this is some references package that might be needed http://www.sitepoint.com/10-essential-sublime-text-plugins-full-stack-developer/

Standard
Uncategorized

Tech reSolution in 2014

Self.Happy_NewYear()

in this year , i will adding some Wish List for improving my skills . Hmmm wait ….. another wish list here , not for fashion or gadget as usual i think . I called it Tech reSolution .

1. Learn Django for some Fun

office hours i’am doing office job as web developer ( not sure , i’am only data entry ) LoL :)) , in the night for lullabies i’am doing some stuff for FUN by learning Django . I wish , it will be little impact for my life :)

2. Learn JS

I think , i’am too bad in JS :(     for some project, it is requirement .

3. Deeping API to be Real Back End Developer

Not Sure i’am a back end developer ? i don’t want to be full stack programmer surely :(

4. reSIGN
LoL :))

Standard
Uncategorized

Cheat sheet to Create Facebook Application

Some weeks ago , i am trying to build a micro site for vote some cover of the year for Mother & Baby magazine . User must likes fans page of Mother & Baby before vote the cover .

In this case , i must have an account to be developer facebook . For this step , you must only go to developer.facebook.com and fill the form for set up your developer account.  For more info see in here.

Not receiving a mobile confirmation code from Facebook?

hahaha LoL …

Text “F” (without quotes) to 32665 and you should instantly receive the code

see in here, here and here .

Ganbate until you win with this alien :))

Important after register as developer facebook

– Fill App Domain in App setting with WWW before your domain . example : http://www.yourdomain.com

– If you want to create Login page in your site , please fill Site URL with http first and put / in end of your site url . example : http://subdomain.domain.com/

Remember your App ID for buid your application :)

Standard

Celebrate Software Freedom Day 2013

Happy Software Freedom Day penguin’s , september 2013

Uncategorized

Celebrate Software Freedom Day 2013

Image
Programing, python

Controlling lamp using DFRDuino and Twitter

Hai guyss ? missed me ? hahaha | well , iam back to share with you all . after completion my bachelor degree  in january 2013 and busy with my job now , i will share with you again :) .  hmmm i will discuss something around my essay now . For fulfill my bachelor  degree , each student must create one software and i try to take microcontroller for my essay .

Controlling Lamp using DFRDuino Uno and Twitter

lets discuss it !

Hardware

iam using DFRDuino board , its same as arduino  . Only different producer , dont scare :) and Relay for Hardware .

DFRDuino uno is hardware that designed with component consist USB to serial conventer port and some resistor and a microcontroller chip with kind of ATmega8U2 for main component. For DFRDuino board specification you can see in this link.

Relay Shield is an electrically operated switch . I use it for join with DFRDuino board and then connecting with lamp . See relay specification in here .

For hardware schema see picture 1.1

hardware schemapicture 1.1

For system schema see picture 1.2

rich_picturepicture 1.2

Software

python ( wxPython for GUI ) , Tweety Library, C in arduino and working with twitter API .

Here is my final stuff

Controlling lamp using twitter

in GUI , i create scheduling program if user want to create schedule for each lamp . Launch the program in desktop and its automate stream twitter time line in back ground for accept user request via mention .

enjoy :)

Standard
Linux, Networking

Solving error: [ 0.000000] Fast TSC calibration failed when booting in fedora 16

Getting error while booting in fedora 16 like

error: [ 0.000000] Fast TSC calibration failed when booting in fedora 16

check:

#cat /var/log/message | grep TSC

this is to show log message of TSC

#cat /proc/cpuinfo | grep tsc

#cat /sys/device/system/clocksource/clocksource0/available_clocksource

#cat /sys/device/system/clocksource/clocksource0/current_clocksource

this problem are : counter time stamp > synchronization time maybe in network app when booting is to slow/fast

do:

#gedit /etc/default/grub

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=”Fedora”
GRUB_DEFAULT=saved
GRUB_CMDLINE_LINUX=”rd.md=0 rd.lvm=0 rd.dm=0 KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.luks=0 LANG=en_US.UTF-8″

change to be:

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=”Fedora”
GRUB_DEFAULT=saved
GRUB_CMDLINE_LINUX=”LANG=en_US.UTF-8 rd.md=0 rd.lvm=0 rd.dm=0 SYSFONT=latarcyrheb-sun16 rd.luks=0 KEYTABLE=us rhgb quiet clocksource=acpi_pm

save .

#grub2-mkconfig -o /boot/grub2/grub.cfg

#reboot

problem solved, isnt it ? :D

Standard