Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| // Before | |
| function foo(hello, world, | |
| how, are, | |
| you) { | |
| } | |
| // After | |
| function foo(parameters) { | |
| var hello = parameters.hello; |
| use "assignment1.sml"; | |
| (* assert for test *) | |
| fun assert (e: bool, message: string) = | |
| let val prefix = "Testing [" ^ message ^ "]" | |
| in if e then print( prefix ^ "----PASS\n") | |
| else print(prefix ^ "----FAIL\n") | |
| end | |
| (* factroies for Q1-Q5 *) |
| # I created a generic Rails like ApplicationController so that you can just | |
| # run this code via a command line prompt without the need for Rails | |
| module Recorder | |
| def self.included(base) | |
| base.send(:before_filter, :some_method) | |
| base.send(:after_filter, :another_method) | |
| end |
| require 'spec_helper' | |
| require 'rack/test' | |
| describe App do | |
| include Rack::Test::Methods | |
| le_me { Object.new } | |
| le(:app) { App } |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| class TrueClass | |
| def dat | |
| self | |
| end | |
| end | |
| true.dat # => true |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Ansi 0 Color</key> | |
| <dict> | |
| <key>Blue Component</key> | |
| <real>0.0</real> | |
| <key>Green Component</key> | |
| <real>0.0</real> |
| if defined? ActiveRecord | |
| def explain(query) | |
| query = query.to_sql if query.is_a?(ActiveRecord::Relation) | |
| ActiveRecord::Base.connection | |
| .execute("EXPLAIN ANALYZE #{query}") | |
| .to_a | |
| .each { |hash| puts hash["QUERY PLAN"] } | |
| nil |
| server = "google.com" | |
| cmd = "ping -c 1 #{server}" | |
| while true do | |
| `#{cmd}` | |
| if ($?.exitstatus != 0) | |
| puts "Down: " + Time.now.to_s | |
| while ($?.exitstatus != 0) do | |
| `#{cmd}` | |
| end | |
| puts "Up: " + Time.now.to_s |