Skip to content

Instantly share code, notes, and snippets.

View blakejakopovic's full-sized avatar

Blake Jakopovic blakejakopovic

View GitHub Profile
@brigand
brigand / index.html
Created May 1, 2014 23:16
React Drag and Drop
<div id="main"/>
<script type="text/jsx">
/** @jsx React.DOM */
var DragItem = React.createClass({
drag: function(ev) {
ev.dataTransfer.setData("draggedItem", JSON.stringify(this.props.item));
},
render: function () {
return (<div draggable="true" onDragStart={this.drag} className="item">{this.props.item.text}</div>);
}
user=> (ns there)
nil
there=> (defmulti ^:private doit identity)
#'there/doit
there=> (defmethod doit 1 [x] x)
#<MultiFn clojure.lang.MultiFn@d2de489>
there=> (doit 1)
1
there=> (in-ns 'user)
#<Namespace user>
gemcutter => redis downloads spec
=================================
keys
----
downloads => global counter for all gem downloads
downloads:today => sorted set for downloads from today
downloads:rubygem:rails => counter for all rails downloads
downloads:version:rails-2.3.5 => counter for all rails 2.3.5 downloads
task :deploy => ['deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
task :migrations => [:push, :off, :migrate, :restart, :on, :tag]
task :rollback => [:off, :push_previous, :restart, :on]
task :push do
puts 'Deploying site to Heroku ...'
puts `git push heroku`
end
@jhuckabee
jhuckabee / tmux_iterm2.rb
Created March 14, 2012 17:40
Brew script for 'Tmux for iTerm2'
require 'formula'
class TmuxIterm2 < Formula
url 'http://iterm2.googlecode.com/files/tmux-for-iTerm2-20120203.tar.gz'
md5 '59305a26bdd0245054fe719e6b2a960e'
homepage 'http://code.google.com/p/iterm2/downloads/detail?name=tmux-for-iTerm2-20120203.tar.gz&can=2&q='
depends_on 'libevent'
def install
@clauswitt
clauswitt / BitArray.coffee
Created March 25, 2012 10:13
A BitArray Implementation in CoffeeScript
class BitArray
width: 24
constructor: (size=24, default_value = 0) ->
@size = size
initialElements = Math.floor(size / @width) + 1
@field = []
for i in [0...initialElements]
@field[i] = 0
@jhulten
jhulten / server.clj
Created May 26, 2012 06:09
clojure udp aleph example
(ns statsd-clj.server
(:use [aleph.udp]
[gloss core io]
[lamina core api])
(:require [statsd-clj.config :as config]
[statsd-clj.metrics :as metrics]
[clojure.tools.logging :as log]))
(def socket-server (agent nil))
{
"auto_indent": true,
"auto_match_enabled": true,
"caret_style": "smooth",
"close_windows_when_empty": true,
"color_scheme": "Packages/Theme - Aqua/Color Schemes/Tomorrow Night Aqua.tmTheme",
"detect_indentation": true,
"dictionary": "Packages/Language - English/en_US.dic",
"draw_centered": false,
"draw_indent_guides": true,
@neonichu
neonichu / dashpod.rb
Created August 7, 2013 19:44
Ruby script which adds documentation for all dependencies from a Podfile to Dash. It's rather hacky and was only tested on Sea Lion, so use at your own risk.
#!/usr/bin/env ruby
require 'rubygems'
require 'cocoapods-core'
require 'json'
require 'mechanize'
require 'rest-client'
docs = JSON.parse(RestClient.get('http://cocoadocs.org/documents.jsonp')[12..-22])
@technobly
technobly / sparkDS1307.cpp
Last active May 14, 2016 06:28
RTC DS1307 LIBRARY FOR SPARK CORE
//-----------------------------------------------//
// RTC DS1307 LIBRARY FOR SPARK CORE //
//===============================================//
// Copy this into a new application at: //
// https://www.spark.io/build and go nuts! //
// !! Pinouts on line 254 below !! //
//-----------------------------------------------//
// Technobly / BDub - Jan 12th 2014 //
//===============================================//
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"