Skip to content

Instantly share code, notes, and snippets.

View aa21's full-sized avatar

Alex Arul aa21

  • Hatcher, Blk 71
  • singapore
View GitHub Profile
<?php
class MM_Notifications {
private $usr_mentor;
private $usr_mentee;
private $mentor_action;
private $email_codes;
private $notice_type;
private $debug_email;
@aa21
aa21 / Project Ideas.md
Last active August 24, 2016 01:15
Learning / Mastering a language
<?php
// if it's not a ISO8601 date string, skip it
if(stripos($v , "T") === false) continue;
$dateval = $v;
// create ISO8601 dateTime
$date = DateTime::createFromFormat(DateTime::ISO8601, $dateval);
// set to user's timezone
$date -> setTimeZone($dt_user_timezone);
@aa21
aa21 / instagram_scrape.php
Created June 17, 2016 07:20 — forked from cosmocatalano/instagram_scrape.php
Quick-and-dirty Instagram web scrape, just in case you don't think you should have to make your users log in to deliver them public photos.
<?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;
}
@aa21
aa21 / instagram-fetcher.php
Created June 17, 2016 07:19 — forked from shahrilnet/instagram-fetcher.php
Simple Instagram media info fetcher
<?php
/*
* title : simple instagram info fetcher
*
* author : shahril
* receipant : afif zafri
* date : 29-dis-2015
*/
@aa21
aa21 / git.git
Created January 26, 2016 08:45
Git stuff
-- ignore changes to local file, db, config etc.
git update-index --assume-unchanged [<file>...]
.git/info/exclude
.gitignore
@aa21
aa21 / Regex
Created January 19, 2016 04:22
# Word not in string
^((?!cat).)*$ <-- Match sentence not containing 'cat'
@aa21
aa21 / vim.vim
Last active January 20, 2016 05:54
# 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
@aa21
aa21 / books.md
Last active October 1, 2015 07:28
Coding Books etc
@aa21
aa21 / .php
Last active October 18, 2016 14:26
PHP - Aligning tabs, finding emails in string, remove empty columns from csv/data-grid array ..
<?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);