As configured in my dotfiles.
start new:
tmux
start new with session name:
| // Alternative JavaScript Syntax | |
| Person = :(name, address) { @name!, @address! } | |
| Person::inspect = :{ <: "{@name} lives at {@address}" } | |
| tj := Person('TJ', '314 Bessborough ave') | |
| bob := Person('Bob', 'Some place') | |
| [tj, bob].each(:(person){ print(person.inspect()) }) |
| class TodoList < Array | |
| def self.load(file) | |
| # read the file, create a list, create items, add them to the list, return the list | |
| list = TodoList.new | |
| File.read(file).each_line do |line| | |
| list << line.chomp | |
| end | |
| list | |
| end |
| require 'benchmark' | |
| class Proc | |
| def slow_callback(callable, *args) | |
| self === Class.new do | |
| method_name = callable.to_sym | |
| define_method(method_name) { |&block| block.nil? ? true : block.call(*args) } | |
| define_method("#{method_name}?") { true } | |
| def method_missing(method_name, *args, &block) false; end | |
| end.new |
| >> IF = -> b { b } | |
| => #<Proc:0x007fb4e4049cc8 (lambda)> | |
| >> LEFT = -> p { p[-> x { -> y { x } } ] } | |
| => #<Proc:0x007fb4e403d680 (lambda)> | |
| >> RIGHT = -> p { p[-> x { -> y { y } } ] } | |
| => #<Proc:0x007fb4e4028ff0 (lambda)> | |
| >> IS_EMPTY = LEFT |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
| # === EDITOR === | |
| Pry.editor = 'vim' | |
| # == Pry-Nav - Using pry as a debugger == | |
| Pry.commands.alias_command 'c', 'continue' rescue nil | |
| Pry.commands.alias_command 's', 'step' rescue nil | |
| Pry.commands.alias_command 'n', 'next' rescue nil | |
| Pry.commands.alias_command 'r!', 'reload!' rescue nil | |
| Pry.config.color = true |
| Windows Registry Editor Version 5.00 | |
| [HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\monokai] | |
| "Colour21"="255,255,255" | |
| "Colour20"="245,222,179" | |
| "Colour19"="200,240,240" | |
| "Colour18"="0,217,217" | |
| "Colour17"="179,146,239" | |
| "Colour16"="174,129,255" | |
| "Colour15"="122,204,218" |
| pdftk original.pdf output uncompressed.pdf uncompress | |
| LANG=C sed -n '/^\/Annots/!p' uncompressed.pdf > stripped.pdf | |
| pdftk stripped.pdf output final.pdf compress |