Skip to content

Instantly share code, notes, and snippets.

View Ridermansb's full-sized avatar
🤔
Always thoughtful

Riderman de Sousa Barbosa Ridermansb

🤔
Always thoughtful
View GitHub Profile
(function( jQuery ) {
var getScript = jQuery.getScript;
jQuery.getScript = function( resources, callback ) {
var // reference declaration & localization
length = resources.length,
handler = function() { counter++; },
deferreds = [],
@funkatron
funkatron / twitter-oauth-pin.html
Created May 19, 2011 01:06
A simple example of PIN-based oauth flow with Twitter and jsOAuth
<!DOCTYPE html>
<html>
<head>
<!--
A simple example of PIN-based oauth flow with Twitter and jsOAuth.
This is mostly based on/copied from <http://log.coffeesounds.com/oauth-and-pin-based-authorization-in-javascri>.
Get jsOAuth at <https://github.com/bytespider/jsOAuth/downloads>
@MarkusObrist
MarkusObrist / git-mergetool-winmerge-setup.sh
Created June 6, 2011 13:28 — forked from adilsoncarvalho/git-mergetool-winmerge-setup.sh
shell script that configures git to use WinMerge as the default tool to handle conflicts
#!/bin/sh
#
# This script will make WinMerge your default tool for diff and merge.
# It must run inside git bash (on Windows)
#
# If your WinMerge is in other place then this one, please edit
WINMERGE_SCRIPT="winmerge-merge.sh"
@bytespider
bytespider / boilerplate.coffee
Created July 8, 2011 05:51
jsOAuth boilerplate for PIN based authentication in javascript
openAuthoriseWindow = (url) ->
waitForPin = ->
if wnd.closed
pin = prompt("Please enter your PIN", "")
oauth.setVerifier pin
oauth.fetchAccessToken getSomeData, failureHandler
else
setTimeout waitForPin, 100
wnd = window.open(url, "authorise")
setTimeout waitForPin, 100
@rally25rs
rally25rs / MvcMockHelpers.cs
Created January 8, 2012 15:26
MvcMockHelpers.cs - Helper Utility for Mocking MVC3 Controllers with Moq.
using System;
using System.Collections.Specialized;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Moq;
/// <summary>
/// This helper class can be used to set up Moq mocks of MVC3 controllers.
/// Slightly modified from the original version from Scott Hanselman's blog:
@kamranayub
kamranayub / knockout.compiledTemplateSource.js
Created March 21, 2012 19:47
Pre-compiled jQuery tmpl support for KO 2.0.0
// jQuery.tmpl Compiled Source Plugin for Knockout 2.0
// Kamran Ayub - http://kamranicus.com
//
// Adds support for referencing named pre-compiled templates
// e.g. $.template('name', 'markup')
//
// Specifically, this makes Cassette Knockout compiled templates
// work in KO 2.0.0
(function (ko) {
ko.templateSources.compiledTemplateSource = function (name) {
@gzoller
gzoller / kinetic.bezier.js
Created April 13, 2012 22:43
Kinetic Plug-Ins
/**
* KineticJS Bezier Extension
* Compatible with KineticJS JavaScript Library v3.8.0
* Author: Greg Zoller
* Date: Apr 12 2012
*/
///////////////////////////////////////////////////////////////////////
// Bezier
///////////////////////////////////////////////////////////////////////
@liammclennan
liammclennan / blog_backbone_server.md
Created June 19, 2012 22:25
Zero Configuration Backbone.js Server

Backbone-Server is a zero configuration backbone.js server. For teaching, experimentation and debugging it provides an instant server-side for backbone.js apps. Once installed it is started like so:

node rasterver.js

Then from the client you can work with models:

var Person = Backbone.Model.extend({}),
People = Backbone.Collection.extend({
    model: Person,

url: 'http://localhost:3000/People'

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active November 17, 2024 01:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@sherbrow
sherbrow / dropdown-btn.css
Created July 2, 2012 19:38
Twitter-bootstrap add-on to create dropdowns in button groups (like http://jsfiddle.net/Sherbrow/3R3EV/6/ )
.dropdown-btn {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */
*zoom: 1;
padding: 4px 10px 4px;
margin-bottom: 0;
font-size: 13px;