Skip to content

Instantly share code, notes, and snippets.


Orlin M Bozhinov orlin

  • Astrolet
  • Varna, Bulgaria
  • Twitter @orlin
View GitHub Profile
jimeh /
Created Apr 7, 2011
Example jQuery plugin written in CoffeeScript, and the resulting compiled JavaScript file.
myplugin: (options) ->
self = $.fn.myplugin
opts = $.extend {}, self.default_options, options
$(this).each (i, el) ->
self.init el, opts
self.log el if opts.log
$.extend $.fn.myplugin,
DavidYKay / gist:912765
Created Apr 10, 2011
"Can Code Be Like Literature" - Jeremy Ashkenas
View gist:912765
Absolutely brilliant
both technically
and oratorically
He wrote CoffeeScript
1st place 5k
21 min, 3 seconds
<7min mile
Big picture
topfunky / Cakefile
Created Apr 14, 2011
Watch both Sass and Coffee files and compile on change (for Node.js)
View Cakefile
Modified from
Part of an upcoming PeepCode screencast. This snippet is MIT Licensed.
{spawn, exec} = require 'child_process'
task 'assets:watch', 'Watch source files and build JS & CSS', (options) ->
runCommand = (name, args) ->
jboesch / AjaxForm Jasmine Test.js
Created Apr 20, 2011
RequireJS, BackboneJS and testing with Jasmine. Whew.
View AjaxForm Jasmine Test.js
describe("AjaxForm", function() {
// Local vars for manipulation
var $form = null,
_requirejs_loaded = false,
found_errors = false,
submitted_successfully = false,
AjaxFormInstance = null,
RequireJSViews = {
AjaxFormView: null
# Extend jQuery objects with Underscore collection methods.
# Each collection method comes in two flavors: one prefixed
# with _, which yields a bare DOM element, and one prefixed
# with $, which yields a jQuery-wrapped element.
# So if `this` is a jQuery object, instead of:
# _.max @, (el) -> $(el).height()
View gist:950965
# Conditional decrement.
# Decrement the value of a key only if the current value is greater than
# a specified value.
require 'rubygems'
require 'redis'
r =
cond_decr = <<LUA
bernerdschaefer / gist:962715
Created May 9, 2011
some bash helpers for working with padrino projects
View gist:962715
alias rake="time rake"
# Run `padrino rake` when inside a padrino project,
# otherwise run the normal rake command.
function rake () {
if [[ -f ".components" ]]; then
padrino rake $*
ruby -S rake $*
igrigorik /
Created May 27, 2011
wrapping esper with JRuby embrace
// A simple Tweet POJO:
// $> javac
public class TweetEvent {
private String user;
private String text;
private String timezone;
private int retweets;
public TweetEvent(String user, String text, String timezone, int retweets) {
jicksta / gist:1001736
Created Jun 1, 2011
Jasmine shared behavior for asserting that a certain event on an element exposed as a Backbone view property properly executes the expected view instance method
View gist:1001736
function assertViewAction(viewClass, eventCallbackName, elementAccessorName, eventName, viewReference) {
it("should run the " + eventCallbackName + " action when the " + elementAccessorName + " gets a " + eventName + " event (assertViewAction)", function() {
var isPrototypal = eventCallbackName in viewClass.prototype;
if (isPrototypal) {
spyOn(viewClass.prototype, eventCallbackName);
var view = viewReference();
if (!isPrototypal) {
spyOn(view, eventCallbackName);
kriszyp / my-widget.js
Created Jun 24, 2011
This is how I want to write structured documentation and unit tests
View my-widget.js
/* This is the module, the implementation, distinct from the specification/interface. */
define([...deps...], function(){
return function(options){