Skip to content

Instantly share code, notes, and snippets.

@abeMedia
abeMedia / datatables.css
Created Mar 9, 2014
jQuery Datatables Boostrap 3 CSS
View datatables.css
div.dataTables_length label {
font-weight: normal;
float: left;
text-align: left;
}
div.dataTables_length select {
width: 75px;
}
@abeMedia
abeMedia / index.php
Last active Aug 29, 2015
Get all Facebook albums & photos of a user
View index.php
<?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 / gist:1fbe7b829b8818c0af16
Created Mar 6, 2015
Install Jekyll on Openshift Jenkins Gear
View gist:1fbe7b829b8818c0af16
#!/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 / regex
Created Nov 1, 2015
Simple regex to extract Google Plus ID from a user submitted URL
View regex
/(?:https?:\/\/)?(?:plus\.google\.com\/)?(?:.\/.\/*)?([^\/\s]*)/i
@abeMedia
abeMedia / regex
Created Nov 1, 2015
Simple regex to extract Google Plus ID from a user submitted URL
View regex
/(?:https?:\/\/)?(?:plus\.google\.com\/)?(?:.\/.\/*)?([^\/\s]*)/i
@abeMedia
abeMedia / google-cse-bootstrap.less
Created Oct 27, 2015
Google Custom Search Bootstrap Theme
View google-cse-bootstrap.less
/* Google Custom Search - Bootstrap Theme
-------------------------------------------------- */
@gs-title-size: @font-size-h4;
@gs-url-color: @brand-success;
@gs-thumbnail-size: 90px;
/* Search Form
@abeMedia
abeMedia / .css
Last active Feb 12, 2018
Pure CSS horizontal accordion slider
View .css
.donslide {
display: table;
width: 100%;
}
.donslide .item {
display: table-cell;
width: 1%;
transition: 0.6s ease-in-out all;
overflow: hidden;
position: relative;
View config.cson
"*":
"atom-beautify":
general:
_analyticsUserId: "b4c23a8d-a7fc-4786-b02d-51655c7cdbe5"
js:
beautify_on_save: true
default_beautifier: "ESLint Fixer"
vue:
break_chained_methods: true
default_beautifier: "ESLint Fixer"
View api-client.js
class APIError extends Error {
constructor(response) {
super(response.message);
this.name = 'APIError';
this.code = `errors.${response.code}`;
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
} else {
this.stack = new Error().stack;
}
@abeMedia
abeMedia / toggle-touchpad.sh
Created Apr 19, 2020
Bash script to toggle touchpad on/off
View toggle-touchpad.sh
#!/bin/bash
read TPdevice <<< $( xinput | sed -nre '/TouchPad/s/.*id=([0-9]*).*/\1/p' )
state=$( xinput list-props "$TPdevice" | grep "Device Enabled" | grep -o "[01]$" )
if [ "$state" -eq '1' ];then
xinput --disable "$TPdevice"
notify-send Touchpad Disabled
else
xinput --enable "$TPdevice"