Javascript
Learning Javascript Design Patterns, Addy Osmani http://addyosmani.com/resources/essentialjsdesignpatterns/book/
Pro JavaScript™ Design Patterns, Ross Harmes and Dustin Diaz http://www.vashstile1.ru/assets/files/price.pdf
| # Serve Static Files from public folder | |
| app.use(express.static('public')); | |
| # Serve "public" folder's files as Static Files from path "/static" | |
| app.use('/static', express.static('public')); | |
| # Hosting apache & NodeJS on same server | |
| <VirtualHost *:80> | |
| ServerName bms.komiapp.com | |
| ProxyPreserveHost on |
| Blockchain | |
| - Anything that can be mathematically represented | |
| - can be modelled | |
| - secured | |
| - traded | |
| Privacy: | |
| - Info, Identity, Funds are private | |
| Contract: Program that runs everytime a message called a transaction is received |
| #installing mongodb | |
| vim /etc/yum.repos.d/mongodb.repo | |
| [mongodb] | |
| name=MongoDB Repository | |
| baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/ | |
| gpgcheck=0 | |
| enabled=1 | |
| yum install mongo-10gen mongo-10gen-server | |
| chkconfig mongod on |
| <?php | |
| // PRINT TAB ALIGNED COLUMNS | |
| // %- and % are left and right aligns | |
| $mask = "| %-30.30s | %10.10s | %10.10s |\n"; | |
| printf($mask, 'Host' , 'Results', 'Share'); | |
| printf($mask, $test_host, $total_results, $share_round); | |
Javascript
Learning Javascript Design Patterns, Addy Osmani http://addyosmani.com/resources/essentialjsdesignpatterns/book/
Pro JavaScript™ Design Patterns, Ross Harmes and Dustin Diaz http://www.vashstile1.ru/assets/files/price.pdf
| # Learn Vim Fast | |
| https://robots.thoughtbot.com/the-vim-learning-curve-is-a-myth | |
| # VIM Tutorial | |
| http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html | |
| # Derek Wyatt's awesome vim series | |
| http://vimeo.com/user1690209/videos | |
| # Vimcasts |
| # Word not in string | |
| ^((?!cat).)*$ <-- Match sentence not containing 'cat' |
| -- ignore changes to local file, db, config etc. | |
| git update-index --assume-unchanged [<file>...] | |
| .git/info/exclude | |
| .gitignore |
| <?php | |
| /* | |
| * title : simple instagram info fetcher | |
| * | |
| * author : shahril | |
| * receipant : afif zafri | |
| * date : 29-dis-2015 | |
| */ |
| <?php | |
| //returns a big old hunk of JSON from a non-private IG account page. | |
| function scrape_insta($username) { | |
| $insta_source = file_get_contents('http://instagram.com/'.$username); | |
| $shards = explode('window._sharedData = ', $insta_source); | |
| $insta_json = explode(';</script>', $shards[1]); | |
| $insta_array = json_decode($insta_json[0], TRUE); | |
| return $insta_array; | |
| } |