Skip to content

Instantly share code, notes, and snippets.

View satlavida's full-sized avatar

Satyajeet Nigade satlavida

View GitHub Profile
@satlavida
satlavida / CPNavigationBar.j
Created October 4, 2011 15:01 — forked from nickjs/CPNavigationBar.j
CPNavigationController & CPViewController
/*
* CPNavigationBar.j
* AppKit
*
* Created by Nicholas Small.
* Copyright 2009, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@implementation CalendarView: CPView
{
}
-(id)init {
self = [super initWithFrame:CGRectMake(0, 0, 200, 200)];
if (self) {
[self loadData];
}
@implementation Satlavida : NSObject
{
NSArray Skills;
}
-(NSArray)returnSkills
{
return Skills = ["PHP","Ruby","Objective-C","Objective-J","Cocoa","Java/Coffee-script","HTML5"];
}
window.Events = {}
_.extend Events, Backbone.Events
window.Model = Backbone.Model.extend
window.Collection = Backbone.Collection.extend
window.Router = Backbone.Router.extend
window.View = Backbone.View.extend
addSubview: (ele) ->
@el.append(ele)
he = 1
around = 1;
to = (a) ->
return a
me = (a) ->
return a
hide = "Hide quick, he is here"
alert me to hide if he is around
@satlavida
satlavida / Gemfile
Created December 10, 2011 06:49 — forked from gvarela/Gemfile
web sockets with eventmachine and redis pub/sub
# A sample Gemfile
source "http://rubygems.org"
gem "redis"
gem 'eventmachine', :git => 'git://github.com/eventmachine/eventmachine.git'
gem "em-hiredis"
# gem "em-synchrony"
gem "em-websocket"
@satlavida
satlavida / chat.rb
Created December 25, 2011 06:19 — forked from rkh/chat.rb
Simple Chat Application using the Sinatra Streaming API
# coding: utf-8
require 'sinatra'
set server: 'thin', connections: []
get '/' do
halt erb(:login) unless params[:user]
erb :chat, locals: { user: params[:user].gsub(/\W/, '') }
end
get '/stream', provides: 'text/event-stream' do
@satlavida
satlavida / gist:1554964
Created January 3, 2012 13:52 — forked from devongovett/gist:1039559
JSONDB implementation
###
# JSONDB - a compressed JSON format
# By Devon Govett
# Originally proposed by Peter Michaux - http://michaux.ca/articles/json-db-a-compressed-json-format
#
# jsondb.pack converts an array of objects with the same keys (i.e. from a database)
# and flattens them into a single array, which is much smaller than the pure json
# representation where the keys are repeated for each item in the array.
# Combine with JSON.stringify to send compressed JSON data over the network.
#
@satlavida
satlavida / nested.coffee
Created February 5, 2012 14:12
Nested classes in CoffeeScript
class AlertMyFriends
class AlertMyFriends::Show
constructor: ->
alert "Hello Friends"
amf = new AlertMyFriends
al = new amf.Show()
@implementation CPTextView : CPView
{
DOMElement FIXME_textArea;
id _delegate;
CPScrollView _scrollView;
CPView _contentView;
JSObject _existingSelectStart;