Skip to content

Instantly share code, notes, and snippets.

View adnasa's full-sized avatar
💐

Adnan Asani adnasa

💐
View GitHub Profile
@adnasa
adnasa / discograph-qtip.js
Last active August 29, 2015 14:08
quick and dirty hack to get the discography list from an artist in wikipedia :D
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 November 16, 2014 20:35
Quick play with nodejs fs module
var fs = require('fs');
var _ = require('underscore')._;
var artists = [{
name: 'Raphaeel Saadiq',
album: [
'Instant Vintage'
]
}, {
/*! 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 = {};
# whats up
alias whats="vagrant"
$ ~/workspace/sandbox/__(-_-)__
@adnasa
adnasa / gist:73ed5d3b4459badbdecf
Last active August 29, 2015 14:21
Quite wierd
addresses = _.sortBy(addresses, function(address) {
addressEntity = address.address;
var reducedKey;
reducedKey = ['name', 'city', 'zipCode'].reduce(function(previous, current) {
if (previous && addressEntity.hasOwnProperty(previous) && addressEntity[previous]) {
return previous;
} else if (current) {
return current;
}
});
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@adnasa
adnasa / code.js
Created August 3, 2015 10:32
js prototypal inheritance mindfuck
function Person(name) {
this.name = name;
this.someArray = [];
}
Person.prototype.someArray2 = [];
var adnan = new Person('adnan');
adnan.someArray.push('something1');
adnan.someArray2.push('something2');
@adnasa
adnasa / .editorconfig
Last active September 11, 2015 07:33
.editorconfig suggestion for sphere-sunrise project (open to feedback)
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
module.exports = function (grunt) {
grunt.initConfig({
browserify: {
dist: {
options: {
transform: [
["babelify", {
loose: "all",
stage: 0
}],