Skip to content

Instantly share code, notes, and snippets.

🔥
🚒

Tom Lord tom-lord

🔥
🚒
Block or report user

Report or block tom-lord

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View lease_deals_error_1.sql
UPDATE "lease_deals"
SET "expired_at" = '2018–10–08 23:50:50.138061'
WHERE "lease_deals"."expired_at" IS NULL
AND "lease_deals"."dealership_id" = 1234
AND ( updated_at < '2018–10–08 23:47:32.862470' )
View lease_deal_expire_all_1.rb
class LeaseDeal < ApplicationRecord
def self.expire_all(time: Time.current)
update_all(expired_at: time)
end
end
@tom-lord
tom-lord / active_emoji.rb
Created Jun 25, 2018
Samples from active_emoji.rb
View active_emoji.rb
class Array
alias<<
alias 🈴 concat
alias 💧 drop
alias 🔁 each
alias 🈳❓ empty?
alias 🍀 sample
alias 🎲 sample
alias ♻️ shuffle
alias 👈 push
@tom-lord
tom-lord / edd_cow_test.rb
Last active Jun 25, 2018
Emoji-Driven tests for 🐄
View edd_cow_test.rb
require 'minitest/autorun'
require 'minitest/emoji'
module MiniTest
class Emoji
add_utf_theme :carwow, 0x1f3ce, 0x1f694, 0x1f690, 0x1f6b6
end
end
describe Cow do
View edd_cow.rb
class Cow
def 🔪
"🥩 "
end
end
🐄 = Cow.new
puts 🐄.🔪 # => 🥩
View "A dark room" save file
eyJ2ZXJzaW9uIjoxLjMsImZlYXR1cmVzIjp7ImxvY2F0aW9uIjp7InJvb20iOnRydWUsIm91dHNpZGUiOnRydWUsIndvcmxkIjp0cnVlLCJzcGFjZVNoaXAiOnRydWV9fSwic3RvcmVzIjp7Indvb2QiOjY1MjUsIm1lYXQiOjU2MzAsImJhaXQiOjczOSwic2NhbGVzIjo2NywidGVldGgiOjUwNCwiZnVyIjoyMzAwNCwiY2xvdGgiOjIzNywiY2hhcm0iOjYsImN1cmVkIG1lYXQiOjQzMCwiY29tcGFzcyI6MSwibGVhdGhlciI6MTAxOCwibWVkaWNpbmUiOjUsImJvbmUgc3BlYXIiOjEsInRvcmNoIjo5NSwibCBhcm1vdXIiOjEsIndhdGVyc2tpbiI6MSwicnVja3NhY2siOjEsImlyb24iOjU4MiwiaXJvbiBzd29yZCI6MCwiY2FzayI6MSwid2Fnb24iOjEsInN0ZWVsIHN3b3JkIjoyLCJzdGVlbCI6NDU4LCJpIGFybW91ciI6MSwiY29hbCI6MjgzLCJidWxsZXRzIjo0NjcsImJvbGFzIjoyLCJzIGFybW91ciI6MSwiY29udm95IjoxLCJ3YXRlciB0YW5rIjoxLCJyaWZsZSI6NSwiYmF5b25ldCI6MCwic3VscGh1ciI6NDE0LCJhbGllbiBhbGxveSI6MCwiZW5lcmd5IGNlbGwiOjEyLCJsYXNlciByaWZsZSI6MX0sImNoYXJhY3RlciI6eyJwdW5jaGVzIjo0MCwic3RhcnZlZCI6MSwicGVya3MiOnsic3RlYWx0aHkiOnRydWUsInNjb3V0Ijp0cnVlfX0sImluY29tZSI6eyJnYXRoZXJlciI6eyJkZWxheSI6MTAsInN0b3JlcyI6eyJ3b29kIjoyNX0sInRpbWVMZWZ0Ijo4fSwiYnVpbGRlciI6eyJkZWxheSI6MTAsInN0b3JlcyI6eyJ3b29kIjoyfSwidGltZUxlZnQi
@tom-lord
tom-lord / thebutton.js
Last active Apr 17, 2016
A "nicely formatted" (readable) version of the javascript sourcecode at www.reddit.com/r/thebutton -- taken from http://www.redditstatic.com/reddit.en-gb.KaNkkPAPGl0.js
View thebutton.js
r.thebutton = {
_setTimer:function(e){
var t = "00000",
n = (e > 0 ? e : 0).toString(),
i = t.substring(0, t.length - n.length) + n;
for(var s = 0; s < 4; s++)
r.thebutton._timerTextNodes[s].nodeValue = i[s];
e%100 === 0 && r.thebutton._drawPie(e, 6e4)
},
_countdown:function(){
View Missy Elliott's perfect oscillations
127, 63, 95, 31, 111, 47, 79, 15, 119, 55, 87, 23, 103, 39, 71, 7, 123, 59, 91, 27, 107, 43, 75, 11, 115, 51, 83, 19, 99, 35, 67, 3, 125, 61, 93, 29, 109, 45, 77, 13, 117, 53, 85, 21, 101, 37, 69, 5, 121, 57, 89, 25, 105, 41, 73, 9, 113, 49, 81, 17, 97, 33, 65, 1, 126, 62, 94, 30, 110, 46, 78, 14, 118, 54, 86, 22, 102, 38, 70, 6, 122, 58, 90, 26, 106, 42, 74, 10, 114, 50, 82, 18, 98, 34, 66, 2, 124, 60, 92, 28, 108, 44, 76, 12, 116, 52, 84, 20, 100, 36, 68, 4, 120, 56, 88, 24, 104, 40, 72, 8, 112, 48, 80, 16, 96, 32, 64, 0
@tom-lord
tom-lord / Missy Elliott is reciprocal!
Created Mar 28, 2015
The Missy Elliott encoding algorithm is the inverse of itself!
View Missy Elliott is reciprocal!
MissyElliott.encode("How is this even possible?!")
# => "\xF6\x84\x88\xFD\xB4\x98\xFD\xE8\xF4\xB4\x98\xFD\xAC\xC8\xAC\xC4\xFD\xF8\x84\x98\x98\xB4\xDC\xE4\xAC\x81\xBD"
MissyElliott.encode("\xF6\x84\x88\xFD\xB4\x98\xFD\xE8\xF4\xB4\x98\xFD\xAC\xC8\xAC\xC4\xFD\xF8\x84\x98\x98\xB4\xDC\xE4\xAC\x81\xBD")
# => "How is this even possible?!"
MissyElliott.decode("How is this even possible?!")
# => "\xF6\x84\x88\xFD\xB4\x98\xFD\xE8\xF4\xB4\x98\xFD\xAC\xC8\xAC\xC4\xFD\xF8\x84\x98\x98\xB4\xDC\xE4\xAC\x81\xBD"
MissyElliott.decode("\xF6\x84\x88\xFD\xB4\x98\xFD\xE8\xF4\xB4\x98\xFD\xAC\xC8\xAC\xC4\xFD\xF8\x84\x98\x98\xB4\xDC\xE4\xAC\x81\xBD")
@tom-lord
tom-lord / Missy Elliott example
Created Mar 28, 2015
The Missy Elliott example, copied from my ruby gem (https://github.com/tom-lord/missy_elliott)
View Missy Elliott example
MissyElliott.encode("Example") # => "\xAE\xF0\xBC\xA4\xF8\xE4\xAC"
#"Example"
#--> ["E", "x", "a", "m", "p", "l", "e"]
#--> [69, 120, 97, 109, 112, 108, 101]
#--> ["01000101", "01111000", "01100001", "01101101", "01110000", "01101100", "01100101"]
# Shift yo bits down
#--> ["10001010", "11110000", "11000010", "11011010", "11100000", "11011000", "11001010"]
# Flip it
#--> ["01110101", "00001111", "00111101", "00100101", "00011111", "00100111", "00110101"]
You can’t perform that action at this time.