Skip to content

Instantly share code, notes, and snippets.

Avatar

Idris Mokhtarzada idris

View GitHub Profile
View gist:2eeae431fcbf02fc1068eb9c4a911d19
Verifying my Blockstack ID is secured with the address 1GVKoZ6YR9qjeFGqxKqLmBCaydvtKYbr4h https://explorer.blockstack.org/address/1GVKoZ6YR9qjeFGqxKqLmBCaydvtKYbr4h
View keybase.md

Keybase proof

I hereby claim:

  • I am idris on github.
  • I am idrism (https://keybase.io/idrism) on keybase.
  • I have a public key whose fingerprint is 04FF 1E6F E9C0 B832 7642 6630 B2C9 E54F E841 04FE

To claim this, I am signing this object:

@idris
idris / 0_reuse_code.js
Created Mar 20, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@idris
idris / gmo
Last active Aug 29, 2015
`gmo` command to merge pull requests
View gmo
#!/bin/bash
git merge -m "Merge #$1 from $2 into $(git symbolic-ref --short HEAD)" origin/$2
@idris
idris / gist:8306743
Last active Jan 2, 2016
Phone Number Country Code Dropdown
View gist:8306743
<select size="1" name="phone_number_country_code">
<option value="1" selected="">United States and Canada (+ 001)</option>
<option value="93">Afghanistan (+ 093)</option>
<option value="355">Albania (+ 355)</option>
<option value="213">Algeria (+ 213)</option>
<option value="684">American Samoa (+ 684)</option>
<option value="376">Andorra (+ 376)</option>
<option value="244">Angola (+ 244)</option>
<option value="1">Anguilla (+ 001)</option>
<option value="672">Antarctica (+ 672)</option>
@idris
idris / boxen dependency cycle
Created Nov 11, 2013
I'm getting this when running boxen. I'm on mavericks.
View boxen dependency cycle
Error: Could not apply complete catalog: Found 1 dependency cycle:
(File[/Users/idris/src/our-boxen/script/boxen-git-credential] => File[/opt/boxen/bin/boxen-git-credential] => Repository[/opt/boxen/homebrew] => Class[Homebrew] => Class[Main] => Node[default] => File[/Users/idris/src/our-boxen] => File[/Users/idris/src/our-boxen/script/boxen-git-credential])
Try the '--graph' option and opening the resulting '.dot' file in OmniGraffle or GraphViz
@idris
idris / github.sh
Created Nov 13, 2012
command-line utility that opens a browser to the given file/directory/commit in GitHub. Now has blame command which opens github blame page.
View github.sh
#!/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
@idris
idris / fix-layout-slugs-mongo.js
Created Dec 6, 2011
Script to update theme slugs
View fix-layout-slugs-mongo.js
/********************************************************************
* fix-theme-slugs-mongo.js
*
* To run, replace localhost/db_name with your connection info and
* run this command:
*
* mongo localhost/db_name --quiet fix-layout-slugs-mongo.js
*
*/
@idris
idris / lesswatch.js
Created Jul 13, 2011
lesswatch command that can be run to watch a directory and compile .less files to .css files when they are modified.
View lesswatch.js
#!/usr/bin/env node
var fs = require('fs');
var exec = require('child_process').exec;
/*
* lesswatch usage:
*
* `lesswatch` to watch the current directory
@idris
idris / github.sh
Created Jan 20, 2011
command-line utility that opens a browser to the given file/directory in GitHub.
View github.sh
#!/bin/bash
FILE=$1
if [ -d $FILE ]; then
DIR=$FILE
else
DIR=`dirname $FILE`
fi
function parse_git_branch {