Skip to content

Instantly share code, notes, and snippets.

View manix84's full-sized avatar
🧸
Being a parent

Rob Taylor manix84

🧸
Being a parent
View GitHub Profile
@manix84
manix84 / .jshintrc
Last active May 3, 2016 14:51
Sublime Settings
{
"white": true,
"sub": true,
"strict": false,
"regexp": false,
"nonew": false,
"evil": true,
"wsh": false,
"undef": true,
"nomen": false,
@manix84
manix84 / wombat.tmtheme
Last active October 6, 2015 02:58
Wombat theme for TextMate, based on the original Vim theme (http://dengmao.wordpress.com/2007/01/22/vim-color-scheme-wombat/)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Lars H. Nielsen (translated by Tony Kemp)</string>
<key>name</key>
<string>Wombat</string>
<key>settings</key>
<array>
@manix84
manix84 / gist:3780621
Created September 25, 2012 08:23
Adding display name to object tree.
var someClassNameHere = {
someVariable: '',
someFunction: function () { // prototype.displayName = "someClassNameHere.someFunction"
console.debug('some message'); // console.debug > "[someClassNameHere.someFunction] some message"
},
someObject: {
someFunction: function () { // prototype.displayName = "someClassNameHere.someObject.someFunction"
console.warn('some message'); // console.warn > "[someClassNameHere.someObject.someFunction] some message"
},
someVariable: 0
@manix84
manix84 / mount_ssh.sh
Last active October 11, 2015 03:57
Mount SSH FS. A very quick way to mount an sshfs drive, as I was finding it a pain.
# Usage: mount_ssh [your_username@]some.server.com:/path/to/mount "[Your Server Name]"
function mount_ssh() {
# Ensure SSHFS is installed before trying to run any commands.
if ! type sshfs >/dev/null 2>&1; then
echo "SSHFS is required to run this command."
echo "If you have Homebrew installed, please run \"brew install sshfs\""
return
fi
local connectionPattern="((.*)@)?(.*)(:(.*))?"
alias grok='find . -type f -not -path "*CVS*" -not -path "*svn*" -not -path "*/tmp/*" -print0 | xargs -0 grep '
alias sgrep='find . -type f -not -path "*CVS*" -not -path "*svn*" -not -path "*/tmp/*" -not -path "*/images/*" -print0 | xargs -0 grep '
alias proj='dir /workplace |grep $USER'
alias ll='ls -la'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias top='top -d 60'
alias svnci='svncommit'
@manix84
manix84 / cdproj.sh
Created October 16, 2012 09:42
Find the name of your workplace directory and cd into it.
function cdproj() {
local projectDir=$(ls /workplace | grep $USER | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g")
cd /workplace/${projectDir}/$1
}
@manix84
manix84 / xgrok.sh
Created October 17, 2012 09:07
Find files named X containing a specified string.
# Usage xgrok "ABC" *.txt
function xgrok() {
find . -name "${2}" -type f | xargs grep -i $1
}
@manix84
manix84 / utils.dependancyCheck.js
Created November 30, 2012 12:32
Checking for dependancies and sending a callback when they have loaded. For use when you're expecting a library to load and you don't know when it'll appear.
(function () {
var utils = window.utils || {};
utils.dependancyCheck = function (dependancies, callback) {
dependancies = !(dependancies instanceof Array) ? [dependancies] : dependancies;
var checkForDependancies = function () {
var i = 0;
for (; i < dependancies.length; ++i) {
if (dependancies[i] !== undefined) {
(function () {
var utils = window.utils || {},
domLoaded = false;
utils.domready = function (callback) {
/* Internet Explorer */
/*@cc_on
@if (@_win32 || @_win64)
document.write("<script id="ieScriptLoad" defer src=\"//:\"><\/script>");
document.getElementById("ieScriptLoad").onreadystatechange = function() {
@manix84
manix84 / fibonacchi-recursive.js
Last active February 8, 2017 15:08
This is my reference when phone screening.
var fibonacci = function (position) {
return position < 1 ? 0 :
position <= 2 ? 1 :
fibonacci(position - 1) + fibonacci(position - 2);
};