This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BaseCollection | |
include Mongoid::Document | |
aggregate(:daily, | |
map: %Q(function() { | |
var key = { | |
year_day: this.year_day, | |
year_week: this.year_week, | |
year_month: this.year_month | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- === MODULE SECTION === | |
import XMonad | |
-- import XMonad.Config.Gnome | |
import qualified XMonad.StackSet as W | |
import XMonad.Util.EZConfig (additionalKeys) | |
import qualified Data.Map as M | |
import XMonad.Hooks.DynamicLog | |
import XMonad.Prompt | |
import XMonad.Prompt.Shell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MyRefinements | |
refine Object do | |
def nice_name | |
"wow I am a #{self.class}" | |
end | |
end | |
refine Hash do | |
def foo | |
"foo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Node A: | |
# iex --sname "nodea" | |
Process.register self, :iex | |
# Blocking | |
receive do | |
{ :hello, pid } -> | |
IO.puts "Hello from #{inspect(pid)}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'ostruct' | |
require 'grape-entity' | |
require 'active_support/concern' | |
module Exposable | |
extend ActiveSupport::Concern | |
# included do | |
# base = self | |
# end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from https://github.com/tomz/liblinear-ruby-swig/blob/master/ext/extconf.rb | |
require 'mkmf' | |
CONFIG["LDSHARED"] = case RUBY_PLATFORM | |
when /darwin/ | |
"g++ -dynamic -bundle -undefined suppress -flat_namespace" | |
else | |
"g++ -shared" | |
end | |
$CFLAGS = "#{ENV['CFLAGS']} -Wall -O3 " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_support/core_ext' | |
require 'ostruct' | |
# require 'debugger' | |
module Factory | |
PRIMARY_KEY_NAME = "name" | |
def self.build(node, content, options={}) | |
Factory.for(node, content, options).produce | |
node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source ~/.bash_colors | |
######### GIT ####################### | |
source /usr/local/git/contrib/completion/git-prompt.sh | |
source /usr/local/git/contrib/completion/git-completion.bash | |
GIT_PS1_SHOWDIRTYSTATE=true | |
# GIT_PS1_SHOWUPSTREAM=true | |
GIT_PS1_SHOWUNTRACKEDFILES=true | |
GIT_PS1_SHOWSTASHSTATE=true | |
export PS1='\[$COLOR_YELLOW\]\u@\h:\[$COLOR_MAGENTA\]\w\[$COLOR_LIGHTCYAN\]$(__git_ps1) \[$COLOR_RESET\]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(global-auto-revert-mode 1) | |
(menu-bar-mode -1) | |
(tool-bar-mode -1) | |
(scroll-bar-mode -1) | |
(global-linum-mode t) | |
;; KEY BINDINGS | |
(global-set-key [s-right] 'next-multiframe-window) | |
(global-set-key [s-left] 'previous-multiframe-window) | |
(global-set-key (kbd "s-o") 'find-file) | |
(global-set-key (kbd "s-n") 'new-frame) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git config --global --list | |
user.name=Andrea Amantini | |
user.email=andrea@devolute.org | |
color.ui=true | |
github.user=zampino | |
core.editor=emacs | |
core.excludesfile=/home/andrea/.gitignore | |
alias.co=checkout | |
alias.a=add | |
alias.s=status |