Dominick Pham EnotionZ

View gist:7537030
1 2 3 4
var getURLParameter = function(name) {
var valStr = decodeURIComponent( (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[0,null])[1]);
return valStr === 'null' ? null : valStr;
};
View .jshintrc
1 2 3 4 5 6 7 8 9 10
{
// --------------------------------------------------------------------
// JSHint Configuration
// --------------------------------------------------------------------
 
// == Enforcing Options ===============================================
//
// These options tell JSHint to be more strict towards your code. Use
// them if you want to allow only a safe subset of JavaScript, very
// useful when your codebase is shared with a big number of developers
View RasPi-blinkToggle.js
1 2 3 4 5 6 7 8 9 10
var gpio = require('gpio');
var header4, header17, intervalTimer;
 
header4 = gpio.export(4);
header17 = gpio.export(17, {
ready: function() {
intervalTimer = setInterval(function() {
header4.set();
setTimeout(function() { header4.reset(); }, 500);
}, 1000);
View test.html
1 2 3 4 5 6 7 8 9 10
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
/*
This code is to fix Microsoft TextRange object (IE8 and below), to give equivalent of
HTML5 Range object's startContainer,startOffset,endContainer and endOffset properties.
*/
/**
View .vimrc
1 2 3 4 5 6 7 8 9 10
syntax on
 
filetype plugin on
 
" Color chart http://vim.wikia.com/wiki/Xterm256_color_names_for_console_Vim
highlight Folded ctermfg=186 ctermbg=234
highlight JSLintError ctermbg=235
 
set winminheight=0
set textwidth=0
View github.sh
1 2 3 4 5 6 7 8 9 10
#!/bin/bash
 
 
function parse_git_branch {
local branch=`cd $DIR;git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ "$branch" == "" ]; then
exit 1
else
echo $branch
fi
View ieversion.js
1 2
// capture x.x portion and store as a number, returns NaN if not IE
var IE = /MSIE (\d+\.\d+);/.test(navigator.userAgent) ? parseFloat(RegExp.$1) : NaN;
View mice.css
1 2 3 4 5 6 7
.mouse{
position: absolute;
background-image: url('../images/cursor.png');
width: 15px;
height: 22px;
z-index: 100;
}
View .bash_profile
1 2 3 4 5 6 7 8 9 10
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
 
# Displays git branch next to directory path
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
local GREEN="\[\033[0;32m\]"
View interfaceDeveloper.js
1 2 3 4 5 6 7 8 9 10
/* An implementation of the interface system in Javascript that takes a design form
similar to other popular object-oriented languages such as Java, C# and PHP. */
Function.prototype.implements = function(){
var class = this;
if(arguments.length < 1) {
throw new Error("Expecting interface as argument but found none.");
}
for (var i =0; i<arguments.length; i++){
Something went wrong with that request. Please try again.