This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo "Sync files" | |
| echo "------------------------------------" | |
| if [ "$1" = "" || $2 = "" ]; then | |
| echo "Source/Dest path can not be null" | |
| exit | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <ctype.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| int | |
| main (int argc, char **argv) | |
| { | |
| int aflag = 0; | |
| int bflag = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| cd `brew --prefix` | |
| git checkout master | |
| git ls-files -z | pbcopy | |
| rm -rf Cellar | |
| bin/brew prune | |
| pbpaste | xargs -0 rm | |
| rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions | |
| test -d Library/LinkedKegs && rm -r Library/LinkedKegs | |
| rmdir -p bin Library share/man/man1 2> /dev/null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # install libs | |
| apt-get install apache2 php5 libapache2-mod-php5 php5-dev | |
| apt-get install gearman-job-server libgearman-dev | |
| apt-get install php-pear | |
| pecl install gearman-1.0.3 | |
| # activate Gearman extension for Apache2 | |
| echo "extension=gearman.so" > /etc/php5/conf.d/gearman.ini |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| typedef struct node { | |
| int key; | |
| struct node *left; | |
| struct node *right; | |
| } node; | |
| int is_odd(node *n){ | |
| // verify the root key | |
| if (n->key % 2 != 0) | |
| return 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $str = "key1=value1&key2=value2&key2=value3&key3=value4"; | |
| $params = explode("&", $str); | |
| $output = array(); | |
| foreach ($params as $param){ | |
| $param = explode("=", $param); | |
| $key = $param[0]; |
NewerOlder