Skip to content

Instantly share code, notes, and snippets.

@darul75
darul75 / gist:ca6bbc23fca2bcc0a564
Created August 5, 2014 07:38
some npm useful command
* Empty cache
npm cache clean
* Uninstall module
npm uninstall [module_name]
* Install module version
npm install [module_name]@[version]
var WIDTH, HEIGHT, canvas, con, g;
var pxs = [];
var rint = 50;
$(document).ready(function() {
$('.get-year').text(new Date().getFullYear());
var $clones = $(".testimonial-list li").clone().sort(function() {
return 0.5 - Math.random();
}).slice(0, 4).removeClass("hidden");
$(".testimonial-list").empty().append($clones);
var windowSize = function() {
@darul75
darul75 / github.css
Last active August 29, 2015 14:10 — forked from andyferra/github.css
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
/*
GITHUB MARKDOWN EXTRACTOR RULES
https://guides.github.com/features/mastering-markdown/
http://www.table-ascii.com/
http://www.loc.gov/marc/specifications/specchartables.html
http://www.utf8-chartable.de/unicode-utf8-table.pl
var fs = require('fs');
Int64 = require('node-int64');
var varint = require('varint');
var lazy = require("lazy");
// http://braindrivendevelopment.com/2013/10/31/reading-a-file-in-node-js/
// http://lucene.apache.org/core/3_0_3/fileformats.pdf
var bufferSegmentGen = fs.readFileSync('./segments.gen');
var bufferSegments = fs.readFileSync('./segments_4o4');
@darul75
darul75 / gist:3a729200f89ab2b0452b
Last active August 29, 2015 14:15
exercise.tour.go
/*********************************************************/
// Exercise: Readers
// https://tour.golang.org/methods/11
package main
import "code.google.com/p/go-tour/reader"
type MyReader struct{}
@darul75
darul75 / ramda.js
Created September 8, 2015 09:59
ramda functional js exercice
// Exercise 1
//==============
// Refactor to remove all arguments by partially applying the function
var words = function(str) {
return _.split(' ', str);
};
var match = R.curry(function(what, x) {
return x.match(what);
// Example Data
var CARS = [
{name: "Ferrari FF", horsepower: 660, dollar_value: 700000, in_stock: true},
{name: "Spyker C12 Zagato", horsepower: 650, dollar_value: 648000, in_stock: false},
{name: "Jaguar XKR-S", horsepower: 550, dollar_value: 132000, in_stock: false},
{name: "Audi R8", horsepower: 525, dollar_value: 114200, in_stock: false},
{name: "Aston Martin One-77", horsepower: 750, dollar_value: 1850000, in_stock: true},
{name: "Pagani Huayra", horsepower: 700, dollar_value: 1300000, in_stock: false}
];
@darul75
darul75 / introrx.md
Created November 9, 2015 21:23 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@darul75
darul75 / fetch-image-as-blob.js
Last active September 28, 2018 18:13
fetch image resources : works well with chrome extension
FetchImageAsBlob('https://gist.github.com/fluidicon.png', function(err, img) {
if (err) {
console.log(err);
return;
}
// play with img
});