Skip to content

Instantly share code, notes, and snippets.

using System;
class ThiClass
{
public static int Main (string [] args)
{
Console.WriteLine ("Igor");
return 0;
}
}
def get_order(request, order_id):
order = Order.get(id=order_id)
data = {}
if request.method == 'GET':
data['order'] = order
elif request.method == 'POST':
order.amount = request.POST.get('amount')
order.save()
elif request.method == 'DELETE':
PROMPT='%{$fg[cyan]%}☁ %{$reset_color%}[%{$fg_no_bold[green]%}$(rvm_ruby)$(current_dir)$(git_last_sha)%{$reset_color%}] '
RPROMPT='$(git_time_since_commit)$(git_prompt_info)'
#PROMPT='%{$fg_no_bold[green]%}$(current_dir)%{$reset_color%} $(git_time_since_commit)$(git_last_sha)$(git_prompt_info)
ZSH_THEME_GIT_PROMPT_PREFIX="%{\e[0;35m%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$reset_color%} %{$fg_bold[red]%}✘%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$reset_color%} %{$fg_bold[green]%}✔%{$reset_color%}"
# Colors vary depending on time lapsed.
hello
This file has been truncated, but you can view the full file.
2012-12-21 00:15:13.785 [info] <0.64.0>@riak_core_sysmon_handler:handle_event:85 monitor long_gc <0.63.0> [{name,timer_server},{initial_call,{timer,init,1}},{almost_current_function,{gen_server,loop,6}},{message_queue_len,2}] [{timeout,150},{old_heap_block_size,0},{heap_block_size,233},{mbuf_size,0},{stack_size,19},{old_heap_size,0},{heap_size,22}]
2012-12-21 00:40:05.177 [info] <0.64.0>@riak_core_sysmon_handler:handle_event:85 monitor long_gc <0.27921.126> [{initial_call,{mochiweb_acceptor,init,3}},{almost_current_function,{mochijson2,json_encode_string_unicode,3}},{message_queue_len,0}] [{timeout,102},{old_heap_block_size,0},{heap_block_size,514229},{mbuf_size,0},{stack_size,84},{old_heap_size,0},{heap_size,247227}]
2012-12-21 01:02:17.278 [error] emulator Error in process <0.31834.126> on node 'riak@127.0.0.1' with exit value: {badarg,[{erlang,binary_to_term,[<<9372 bytes>>],[]},{mi_segment,iterate_all_bytes,2,[{file,"src/mi_segment.erl"},{line,164}]},{mi_server,'-group_iterator/2-fun-0-',2,[{file,"src/mi_
@igorgue
igorgue / gist:4349616
Created December 20, 2012 23:42
Riak search schema for my bucket, it's the default and I always store JSON data.
%% Schema for 'objects'
{
schema,
[
{version, "1.1"},
{n_val, 3},
{default_field, "value"},
{analyzer_factory, {erlang, text_analyzers, whitespace_analyzer_factory}}
# Conway's Game of Life in Ruby
# http://en.wikipedia.org/wiki/Conway's_Game_of_Life
class Cell
attr_writer :neighbors
def initialize(seed_probability)
@alive = seed_probability > rand
end
if key is None:
obj = bucket.new(
data = data
)
else:
obj = bucket.new(
key,
data = data
)
@igorgue
igorgue / .bash_profile
Created September 5, 2012 06:18
YouTube video aliases
alias happydance="open http://youtube.googleapis.com/v/pAKVJIZHLdo?autoplay=1"
alias fcwm="open http://youtube.googleapis.com/v/r5vMkV2OqvY?autoplay=1"
alias whatsup="open http://youtube.googleapis.com/v/ZZ5LpwO-An4?autoplay=1"
alias dayman="open http://youtube.googleapis.com/v/S_JUlXh7sP8?autoplay=1"
alias peepee="open http://youtube.googleapis.com/v/h9hGc1bc610?autoplay=1"
alias guilekfc="open http://youtube.googleapis.com/v/FXRAsUOblV4?autoplay=1"
#!/usr/bin/env python
import pickle
def pow2(number):
return number * number
if __name__ == '__main__':
# Serializing (you could also save this to a file)
serialized_value = pickle.dumps(pow2)