Skip to content

Instantly share code, notes, and snippets.

Avatar

Simone Busoli simoneb

  • NearForm
  • Italy
View GitHub Profile
@piscisaureus
piscisaureus / pr.md
Created Aug 13, 2012
Checkout github pull requests locally
View pr.md

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 = git@github.com: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 Jan 2, 2011
Flatten javascript objects into a single-depth object
View Object Flatten
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;
@noelvo
noelvo / download-multiple-files.js
Created Dec 6, 2015
Download multiple files then compress to one zip file using JSZip & JSZip-utils
View download-multiple-files.js
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 Oct 23, 2015
React-toastr Redux Implementation
View NotficationActionTypes.js
export const RECEIVE_MESSAGE = 'RECEIVE_MESSAGE';
@drunkcod
drunkcod / gist:4488313
Last active Dec 10, 2015
a rough but workable way to "inject" contract tests into a NUnit fixture
View gist:4488313
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace NUnitBehavesLike
{
public interface IThingamabob
{