Skip to content

Instantly share code, notes, and snippets.

View simoneb's full-sized avatar

Simone Busoli simoneb

View GitHub Profile
@noelvo
noelvo / download-multiple-files.js
Created December 6, 2015 23:22
Download multiple files then compress to one zip file using JSZip & JSZip-utils
var zip = new JSZip();
var count = 0;
var zipFilename = "zipFilename.zip";
var urls = [
'http://image-url-1',
'http://image-url-2',
'http://image-url-3'
];
urls.forEach(function(url){
@jerairrest
jerairrest / NotficationActionTypes.js
Created October 23, 2015 05:11
React-toastr Redux Implementation
export const RECEIVE_MESSAGE = 'RECEIVE_MESSAGE';
@drunkcod
drunkcod / gist:4488313
Last active December 10, 2015 20:28
a rough but workable way to "inject" contract tests into a NUnit fixture
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace NUnitBehavesLike
{
public interface IThingamabob
{
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@penguinboy
penguinboy / Object Flatten
Created January 2, 2011 01:55
Flatten javascript objects into a single-depth object
var flattenObject = function(ob) {
var toReturn = {};
for (var i in ob) {
if (!ob.hasOwnProperty(i)) continue;
if ((typeof ob[i]) == 'object') {
var flatObject = flattenObject(ob[i]);
for (var x in flatObject) {
if (!flatObject.hasOwnProperty(x)) continue;