Skip to content

Instantly share code, notes, and snippets.

View FrancoB411's full-sized avatar

Franco Barbeite FrancoB411

View GitHub Profile
@FrancoB411
FrancoB411 / ets.exs
Last active March 15, 2023 18:25 — forked from Miserlou/ets.exs
ets.exs
# Create a new table called `globals
:ets.new(:globals, [:named_table, :public])
# Put some data in it
:ets.insert(:globals, {:are_we_crunching, true})
# Get it back
:ets.lookup(:globals, :are_we_crunching) # true
@FrancoB411
FrancoB411 / tmux-cheatsheet.markdown
Created June 1, 2018 15:08 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
// `unit` is `return` from Haskell
// `bind` is `>>=` from Haskell, or `flatMap` from Scala
var None = {
bind: function (fn) { return this; },
unit: function (v) { return Option(v); },
getOrElse: function (elseValue) { return elseValue; }
};
var Some = function (value) {
@FrancoB411
FrancoB411 / gist:3757824
Created September 20, 2012 19:22 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@FrancoB411
FrancoB411 / .gitconfig
Created September 18, 2012 22:10
Useful gitconfig aliases
[alias]
co = checkout
st = status
rso = remote show origin
# e.g. git graphviz --first-parent master | dotty /dev/stdin
graphviz = "!f() { echo 'digraph git {' ; git log --pretty='format: %h -> { %p }' \"$@\" | sed 's/[0-9a-f][0-9a-f]*/\"&\"/g' ; echo '}'; }; f"
# Pretty log
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
# Print out all commits whose hash starts with a given string
abbr = "!sh -c 'git rev-list --all | grep ^$1 | while read commit; do git --no-pager log -n1 --pretty=format:\"%H %ci %an %s%n\" $commit; done' -"
class ObjectPrinter
#changed param name to item so it's clearer we're sticking an "item" in there and not the class "ObjectPrinter" itself
def print_methods(item)
#added a little space and header to make it easier to read
3.times {puts ""}
puts "#{item} methods:"
puts "----------------------------"
puts ""