Skip to content

Instantly share code, notes, and snippets.


Adnan Asani adnasa

Block or report user

Report or block adnasa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
adnasa / gist:6411938
Last active Dec 22, 2015
Git alias, baby!
View gist:6411938
d = "diff --unified=10"
sh = "show --unified=10"
st = "status"
co = "checkout"
m = "merge"
ls = "log --pretty=format:\"%C(yellow)%h %C(blue)%ad%C(red)%d %C(reset)%s%C(green) [%cn]\" --decorate --date=short"
standup = "log --since '1 day ago' --oneline --author <>"
br = "branch"
bra = "branch -a"
adnasa / gist:6949658
Created Oct 12, 2013
Drupal 7 update password
View gist:6949658
drush upwd admin --password=drupal
adnasa / gist:8454699
Created Jan 16, 2014
Create folder with todays date
View gist:8454699
mkdir `date +%y-%m-%d`
adnasa / gist:9066686
Created Feb 18, 2014
merge HEAD of file from another branch
View gist:9066686
$: git checkout A
$: git checkout --patch B f
adnasa / index.base.php
Created Mar 21, 2014
Base index for silex.
View index.base.php
require_once __DIR__.'/../vendor/autoload.php';
use Symfony\Component\HttpFoundation\Request;
$app = new Silex\Application();
$app->register(new Silex\Provider\TranslationServiceProvider(), array(
'translator.messages' => array(),
adnasa / gist:c5eaf4a31a8e8da91516
Created May 28, 2014
VIM: normal mode new line
View gist:c5eaf4a31a8e8da91516
nmap <S-Enter> o<Esc> " new NEXT line in normal mode
nmap <S-Backspace> O<Esc> " new PREVIOUS line in normal mode
View gitignore_global
# Custom stuff
# Added to my repo
# IDEs and code-editors
adnasa / live templates
Last active Aug 29, 2015
unit-testing snippets
View live templates
# pstorm
$this->assertCount($START$, $COUNTABLE$); $END$
$this->asserTrue($START$, $BOOLEAN$); $END$
$this->asserEquals($START$, $CHECK_EQUAL$); $END$
$this->assertInstanceOf('$START', $INSTANCE$); $END$
adnasa / index.js
Created Oct 18, 2014
get the file-extension
View index.js
var nodePath = require('path');
* @param string filePath
* @return string filePath[extension]
var getFileExtension = function(filePath) {
var extension = nodePath.extname(filePath||'').split('.');
return extension[extension.length - 1];
adnasa / login.js
Created Nov 6, 2014
Login into a system
View login.js
var casper = require('casper').create();
var utils = require('utils');
var URL_LOGIN = "";
var URL_AUTH = "";
var AUTH_TOKEN = null;
var AUTH_EMAIL = null;
var AUTH_PASS = null;
casper.start(URL_LOGIN, function() {
You can’t perform that action at this time.