Clone -> Edit -> Commit -> Push -> Update
hg clone http://bitbucket.org/repo => Clone a remote repo
hg clone project_dir new_changes_dir => Clone a local repo
hg commit -m "Message" => Commit locally changed files.
require "schemed" | |
def deriv(exp, var) | |
case exp | |
when Numeric | |
0 | |
when Symbol, String | |
same_variable?(exp, var) ? 1 : 0 | |
when Sum | |
make_sum deriv(addend(exp), var), deriv(augend(exp), var) |
# Recursively diff two hashes, showing only the differing values. | |
# By Henrik Nyh <http://henrik.nyh.se> 2009-07-14 under the MIT license. | |
# | |
# Example: | |
# | |
# a = { | |
# "same" => "same", | |
# "diff" => "a", | |
# "only a" => "a", | |
# "nest" => { |
#include <stdio.h> | |
#include <stdlib.h> | |
struct closure { | |
void (* call)(struct closure *); | |
int x; | |
}; |
class Array | |
# | |
# Iterates over each permutation of the enumerable values within the | |
# {Array}. | |
# | |
# @yield [list] | |
# The given block will be passed each permutation of the enumerable | |
# values in the {Array}. | |
# |
package go | |
import java.util.concurrent.{ | |
BlockingQueue => JBlockingQueue, | |
ArrayBlockingQueue => JArrayBlockingQueue | |
} | |
object Channel { | |
def empty[A]: Channel[A] = new BlockingChannel() | |
def make[A]: Channel[A] = make(1) |
# in extension to object. | |
# | |
class Object | |
# Returns true if the object sent #in is included in the argument list. | |
# | |
# Usage in conditionals: | |
# | |
# if 1.in 1, 2, 3 | |
# puts "1 was included" | |
# end |
#!/usr/bin/python | |
############################################################################### | |
# Produce a collage (grid) of friend profile images from Facebook. | |
# Inspired by Vipin "swvist" Nair @ https://gist.github.com/2692786 | |
############################################################################### | |
# Copyright (c) 2012 Madzen | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal |
$stack, $draws = [], {} | |
def method_missing *args | |
return if args[0][/^to_/] | |
$stack << args.map { |a| a or $stack.pop } | |
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
end | |
class Array | |
def +@ |
require 'sinatra' | |
get "/" do | |
erb :form | |
end | |
post '/save_image' do | |
@filename = params[:file][:filename] | |
file = params[:file][:tempfile] |