Skip to content

Instantly share code, notes, and snippets.

View ltw's full-sized avatar

Lucas Willett ltw

View GitHub Profile
@ltw
ltw / slack-pagerduty-oncall.py
Created August 17, 2022 17:36 — forked from markddavidoff/slack-pagerduty-oncall.py
Updates a Slack User Group with People that are on call in PagerDuty
#!/usr/bin/env python
from __future__ import print_function
import json
import logging
from urllib2 import Request, urlopen, URLError, HTTPError
from base64 import b64decode
@ltw
ltw / task_list.rb
Last active May 26, 2017 16:35 — forked from gmmowry/task_list.rb
# Today we'll be creating a Task List for an individual
# who has a lot of errands and tasks to complete and multiple
# locations or stores to go to in order to complete them.
# Create a class for a Task List.
# All TaskList instances should have an owner and a dute date
# passed in on creation. For instance, our owner could be "Tyler"
# and his due date would be "Sunday". The owner should not be
# changeable but you should be able to read it outside of the class.
@ltw
ltw / hot.clj
Last active August 29, 2015 14:16 — forked from mattbaker/engima-encode.racket
(def encode
[reflector rotor-l rotor-m rotor-r letter]
(->> (letter-to-index letter)
(rotor-translate-left (rotate rotor-r 1))
(rotor-translate-left rotor-m)
(rotor-translate-left rotor-l)
(reflect reflector)
(rotor-translate-right rotor-l)
(rotor-translate-right rotor-m)
(rotor-translate-right (rotate rotor-r 1)
@ltw
ltw / letterpress.rb
Created October 26, 2012 18:21 — forked from dpick/gist:3956825
class Letterpress
def self.run(board)
all_words = File.open('/usr/share/dict/words').readlines.map! { |line| line.strip.chomp }
valid_words = all_words.select { |w| w =~ /[^#{board.join}]/ }
valid_words = valid_words.select do |w|
bool = true
bool = false if w.size <= 2
split_word = w.downcase.split('')