Skip to content

Instantly share code, notes, and snippets.

@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@sangeeths
sangeeths / github-to-bitbucket
Created March 10, 2014 15:24
Forking a Github repo to Bitbucket
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone git@bitbucket.org:abc/myforkedrepo.git
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync git@github.com:def/originalrepo.git
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync"
git remote -v
@localnerve
localnerve / tfscheckout
Last active May 12, 2016 20:28
Example of using TFS with Grunt (not that you would want to do this, but it can work). Employs the grunt-shell task so that TFS targets play well with other tasks that spawn (like grunt-contrib-compass).
//
// Example showing how to use TFS with grunt.
// Plays well with grunt-contrib-compass and other tasks that spawn processes.
// This example only shows tf checkout, but you could reuse this pattern to add more tf commands.
//
// Gist by https://github.com/localnerve, http://www.localnerve.com
//
var path = require("path");
module.exports = function(grunt) {
@dgs700
dgs700 / objectToQueryString.js
Created January 30, 2013 22:39
Javascript object to URL encoded query string converter. Code extracted from jQuery.param() and boiled down to bare metal js. Should handle deep/nested objects and arrays in the same manner as jQuery's ajax functionality.
var objectToQueryString = function (a) {
var prefix, s, add, name, r20, output;
s = [];
r20 = /%20/g;
add = function (key, value) {
// If value is a function, invoke it and return its value
value = ( typeof value == 'function' ) ? value() : ( value == null ? "" : value );
s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
};
if (a instanceof Array) {