Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Adnan Asani adnasa

🎯
Focusing
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
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
adnasa / index.base.php
Created Mar 21, 2014
Base index for silex.
View index.base.php
<?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
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
cscope.*
tags
phpcd.phar
private
# IDEs and code-editors
.idea
@adnasa
adnasa / live templates
Last active Aug 29, 2015
unit-testing snippets
View live templates
# pstorm
_ac
$this->assertCount($START$, $COUNTABLE$); $END$
_at
$this->asserTrue($START$, $BOOLEAN$); $END$
_e
$this->asserEquals($START$, $CHECK_EQUAL$); $END$
_ins
$this->assertInstanceOf('$START', $INSTANCE$); $END$
@adnasa
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() {
@adnasa
adnasa / discograph-qtip.js
Last active Aug 29, 2015
quick and dirty hack to get the discography list from an artist in wikipedia :D
View discograph-qtip.js
var _ = require('underscore')._;
var casper = require('casper').create({
clientScripts: [
'bower_components/jquery/dist/jquery.min.js',
'bower_components/underscore/underscore.js'
],
verbose: true,
logLevel: 'debug'
});
@adnasa
adnasa / artistAlbumsToMarkdown.js
Created Nov 16, 2014
Quick play with nodejs fs module
View artistAlbumsToMarkdown.js
var fs = require('fs');
var _ = require('underscore')._;
var artists = [{
name: 'Raphaeel Saadiq',
album: [
'Instant Vintage'
]
}, {
View tiny-js-pubsub.js
/*! Js Pub/Sub
* http://anasnakawa.com/
* Copyright (c) Anas Nakawa
* inspired by Ben Alman's one <https://gist.github.com/cowboy/661855>
* MIT License
*/
(function( p ) {
var e = p.e = {};
View what.sh
# whats up
alias whats="vagrant"
You can’t perform that action at this time.