Skip to content

Instantly share code, notes, and snippets.

👁‍🗨
Observing

Ray Minge oranj

View GitHub Profile
@oranj
oranj / _bem.scss
Created Dec 3, 2015
BEM SASS Mixins
View _bem.scss
// BEM mixins (Block, Element, Modifier)
//
// Just google if you're confused.
@mixin block($name) {
@at-root .#{$name} {
@content;
}
}
View gitclean
#! /bin/bash
echo "Before cleanup:";
git branch;
echo "----";
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d;
echo "----";
echo "After cleanup:";
git branch;
View stash_search
@oranj
oranj / vhost
Created Mar 7, 2014
Create a vhost config and add an entry to /etc/hosts, then restart apache.
View vhost
#! /usr/bin/php
<?php
function bad_usage($extra = null, $status = 1) {
if (! is_null($extra)) {
echo "Error: $extra\n\n";
}
echo "Usage: sudo vhost \$directory \$domain\n";
die($status);
}
View url2ascii.php
#!/usr/bin/php
<?php
/**
* Calibration: depending on your fonts and terminal colors, you may want to change these
*/
global $PIXELS, $COLORS, $HSV_COLORS;
$YSCALE = 12;
$XSCALE = 5;
@oranj
oranj / pinch.jquery.js
Created Mar 29, 2013
Touch event pinch / zoom gesture library. jQuery based
View pinch.jquery.js
(function($) {
var TOUCH_START = 'touchstart';
var TOUCH_MOVE = 'touchmove';
var TOUCH_END = 'touchend';
var num_touch_points = function(e) {
var o = e.originalEvent;
if (o.hasOwnProperty('touches')) {
return o.touches.length;
@oranj
oranj / attrs.js
Created Feb 20, 2013
Lets you get a list of values of the provided attributes.
View attrs.js
$.prototype.attrs = function(attr) {
var o = [];
$(this).each(function() {
var v = $(this).attr(attr);
if (v) {
o.push(v);
}
});
return o;
}
View Accessible.php
<?php
class Accessible {
const inst_prefix = 'inst_';
const stat_prefix = 'stat_';
const trans_prefix = 'trans_';
private $data = array();
View jquery tabber... simple and maintainable.
(function($) {
var default_prefs = {
"active_index" : 0,
"active_class" : 'active'
};
var prefs = {};
var methods = {
"init" : function(_prefs) {
var that = this;
You can’t perform that action at this time.