Skip to content

Instantly share code, notes, and snippets.

View oranj's full-sized avatar
👁️‍🗨️
Observing

Raymond Roeming oranj

👁️‍🗨️
Observing
View GitHub Profile
@oranj
oranj / Chatroom.md
Last active December 21, 2016 15:55
@oranj
oranj / _bem.scss
Created December 3, 2015 20:40
BEM SASS Mixins
// BEM mixins (Block, Element, Modifier)
//
// Just google if you're confused.
@mixin block($name) {
@at-root .#{$name} {
@content;
}
}
@oranj
oranj / gitclean
Created June 2, 2015 16:21
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;
@oranj
oranj / stash_search
Created May 28, 2015 19:45
stash_search
@oranj
oranj / vhost
Created March 7, 2014 23:52
Create a vhost config and add an entry to /etc/hosts, then restart apache.
#! /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);
}
@oranj
oranj / url2ascii.php
Last active December 15, 2015 14:08
#!/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 March 29, 2013 15:40
Touch event pinch / zoom gesture library. jQuery based
(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 February 20, 2013 21:33
Lets you get a list of values of the provided attributes.
$.prototype.attrs = function(attr) {
var o = [];
$(this).each(function() {
var v = $(this).attr(attr);
if (v) {
o.push(v);
}
});
return o;
}
<?php
class Accessible {
const inst_prefix = 'inst_';
const stat_prefix = 'stat_';
const trans_prefix = 'trans_';
private $data = array();
(function($) {
var default_prefs = {
"active_index" : 0,
"active_class" : 'active'
};
var prefs = {};
var methods = {
"init" : function(_prefs) {
var that = this;