Skip to content

Instantly share code, notes, and snippets.

@abemedia
abemedia / regex
Created November 1, 2015 04:46
Simple regex to extract Google Plus ID from a user submitted URL
/(?:https?:\/\/)?(?:plus\.google\.com\/)?(?:.\/.\/*)?([^\/\s]*)/i
@abemedia
abemedia / gist:1fbe7b829b8818c0af16
Created March 6, 2015 00:09
Install Jekyll on Openshift Jenkins Gear
#!/bin/bash -l
export HOME="$JENKINS_HOME"
unset GEM_HOME
curl -sSL https://rvm.io/mpapis.asc | gpg --import -
curl -L https://get.rvm.io | bash -s -- --auto-dotfiles --autolibs=0 --ruby
source $JENKINS_HOME/.rvm/scripts/rvm
source $JENKINS_HOME/.profile
@abemedia
abemedia / index.php
Last active August 29, 2015 14:13
Get all Facebook albums & photos of a user
<?php
/**
* Get Facebook Open Graph data.
*/
function getdata($path) {
$url = "http://graph.facebook.com/$path";
$data = json_decode(file_get_contents($url));
return ($data->data?:$data);
@abemedia
abemedia / datatables.css
Created March 9, 2014 00:11
jQuery Datatables Boostrap 3 CSS
div.dataTables_length label {
font-weight: normal;
float: left;
text-align: left;
}
div.dataTables_length select {
width: 75px;
}