Skip to content

Instantly share code, notes, and snippets.

@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);
@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{}
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');
/*
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
@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 {
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 / 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]
/*
* twitter-entities.js
* This function converts a tweet with "entity" metadata
* from plain text to linkified HTML.
*
* See the documentation here: http://dev.twitter.com/pages/tweet_entities
* Basically, add ?include_entities=true to your timeline call
*
* Copyright 2010, Wade Simmons
* Licensed under the MIT license
angular.module('myApp')
.run(['$rootScope', function ($rootScope) {
window.i18n.init(options, function () {
// When finished loading translations, trigger re-evaluation of views for translations
$rootScope.$digest();
});
}])
.filter('translate', [function(){
return function(key, params) {
// i18next needs time to initialize (loading translations). In this phase translation does not work
@darul75
darul75 / gist:7b17026d40df3e236f5f
Created May 3, 2014 12:37
sick beard on mint or linux easy way start as a service
follow instructions here first:
http://sickbeard.com/install.html
then
mv my-sickbeard-install/ .sickbeard
sudo mv .sickbeard/init.ubuntu /etc/init.d/sickbeard
sudo gedit /etc/init.d/sickbeard