Skip to content

Instantly share code, notes, and snippets.

View torifat's full-sized avatar
🇸🇩
Why do we even have this here?

Rifat Nabi torifat

🇸🇩
Why do we even have this here?
View GitHub Profile
@cowboy
cowboy / jquery.ba-ready.js
Created June 25, 2010 20:53
jQuery ready WIP 100% UNTESTED
/*!
* jQuery ready - v0.4pre - 06/28/2010
* http://benalman.com/projects/jquery-ready-plugin/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($,undefined){
@nicolas-brousse
nicolas-brousse / convert_svn_to_git.sh
Last active September 28, 2015 03:07
Convert svn repository to Git repository
#! /bin/sh
#
# Convert svn repository to Git repository
# Author: Nicolas Brousse <nicolas@opsone.net>
# Date: 2013-10-02 17:28:01 UTC
#
# Thanks to: http://www.mabishu.com/blog/2011/01/13/migrate-subversion-repository-to-git-without-loosing-data/
#
set -e
@timothyklim
timothyklim / Application.scala
Created June 12, 2012 17:22
After I talked with co-author of play with topic subdomains, I was a little bit confused. My current framework doesn't support my thoughts and I was started write some code!
// app/controllers/Application.scala
trait SubdomainController extends Controller {
def WithSubdomain(f: => String => Request[AnyContent] => Result) = Action { implicit request =>
val splitDomain = request.domain.split("\\.")
if (splitDomain.length < 2) {
BadRequest("Domain not found!")
} else {
f(splitDomain.head)(request)
@cowboy
cowboy / filter_subdir.sh
Created August 7, 2012 17:41
Make a new repo from a subdirectory of an original repo
# Please don't just RUN this. Do it step-by-step.
user=bocoup
orig_repo=training
new_repo=training-jquery
subdir=jquery-conference
# Pull down the original repo.
git clone git@github.com:$user/$orig_repo.git $new_repo
# Repo, I'm in you.
@ofiesh
ofiesh / git-loglive
Last active December 11, 2015 16:09 — forked from tlberglund/git-loglive
#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all -${1-20}
sleep ${2-10}
done
var Dispatcher = require('the-dispatcher'),
Immutable = require('immutable'),
NotificationConstants = require('../constants/notification_constants'),
UserConstants = require('../constants/user_constants'),
UploadConstants = require('../constants/upload_constants'),
StylesheetConstants = require('../constants/stylesheet_constants'),
makeStore = require('makestore');
/**
* The Notification Store does nothing but store recent actions
@xero
xero / gitlivelog.sh
Created October 1, 2012 21:15
git graph live log
#!/bin/sh
while true;
do
clear
git log \
--graph \
--all \
--color \
--date=short \
-40 \
@sibelius
sibelius / Codemod RN24 to RN25.md
Last active November 9, 2016 13:09
Codemod React Native 24 imports to RN25 imports

README

Why this transform is necessary?

Until React Native 24, you import React from 'react-native' package, but this will change on RN 25, you will need to import React from 'react'. You probably have many files that does this, so I've created a codemod to save you a bunch of time

How to use this

  • Install jscodeshif
@bmeurer
bmeurer / destructuring-performance-test.js
Last active November 17, 2016 06:09
Destructuring performace (V8 ToT 2016/11/16)
/////////////////////////////////////////////////////////////////////////////
// Test framework:
// Warmup
for (var i = 0; i < 1000; ++i) test(data);
function time(test, a) {
let startTime = Date.now();
// Using F.p.apply here to prevent inlining, so we can really
// just measure the performance of test stand-alone.
@mikeobrien
mikeobrien / app.coffee
Created February 21, 2012 04:49
Lazy loading backbone collection + infinite scrolling
class LazyCollection extends Backbone.Collection
indexQuerystring: 'index'
index: 1
lastLength: 0
fetch: (options) ->
options or= {}
if options.reset
@index = 1
@lastLength = 0
else