Skip to content

Instantly share code, notes, and snippets.

View beamdec
#!/usr/bin/env escript
main([BeamFile]) ->
{ok, {_, [{abstract_code, {_, AC}}]}} = beam_lib:chunks(BeamFile, [abstract_code]),
io:fwrite("~s~n", [erl_prettypr:format(erl_syntax:form_list(AC))]).
#Enable repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
#Use current directory as default search scope in Finder
defaults write FXDefaultSearchScope -string "SCcf"
#Show Path bar in Finder
defaults write ShowPathbar -bool true
#Show Status bar in Finder
View expr.erl
% ------------------------------------------------------
% Simple math-expressions parser
artemeff / fish_prompt
Last active Apr 29, 2017
My fish prompt
View fish_prompt
# ~/.config/fish/functions/
# name: Robbyrussell edited
# author: Bruno Ferreira Pinto, edit by Yuri Artemev
function fish_prompt
if not set -q -g __fish_robbyrussell_art_functions_defined
set -g __fish_robbyrussell_art_functions_defined
function _git_branch_name
echo (git rev-parse --abbrev-ref HEAD ^/dev/null)
View gemfile_parser.rb
class GemfileParser
attr_reader :gemfile
EXCLUDED = ["rails"]
def self.gems_status gemfile
def initialize gemfile
View gist:6163880
class BaseWall
def self.Wall length, width, material do
define_method(:length) { length }
define_method(:width) { width }
define_method(:material) { material }
def self.included clazz
private :length, :width, :material
artemeff / tip.rb
Last active Dec 19, 2015
Ruby tips
View tip.rb
# string merging
"asd" "qwe" "zxc"
# => "asdqwezxc"
# separators may be a space
% sometext .size
# => 8