Skip to content

Instantly share code, notes, and snippets.

@maxjacobson
maxjacobson / due
Last active July 24, 2017 00:33
script to print your overdue Due (http://www.dueapp.com/) reminders on Linux
#!/usr/bin/env ruby
# standard libraries
require 'fileutils'
require 'securerandom'
require 'logger'
# external library -- run `gem install oga` before this script will work
require 'oga'
class Lychrel
def initialize(starting_at:)
@start = starting_at
end
def for(iterations:)
last = start
yield last
iterations.times do
require 'yaml'
class MyOrm
attr_accessor :id, :destroyed
def save
!!self.class.write_new(self)
end
def destroy
class Person
def friend
friend_type.new
end
def friend_type
Person
end
end
class Diamonds; end
class Dog
attr_reader :name
end
milo = Dog.new
milo.instance_variable_set('@name', 'Milo')
name = milo.name
name.gsub!(name, 'Lola')
p (lola = milo).name
// https://projecteuler.net/problem=9
// There exists exactly one Pythagorean triplet for which a + b + c = 1000.
// Find the product abc.
package main
import "fmt"
func main() {
a, b, c := findBeautifulTriplet(1000)
fmt.Println(a * b * c)
package main
import "fmt"
func main() {
i := 1
for !coolNumber(i, 20) {
i++
}
fmt.Println(i)
}
package main
import(
"fmt"
"strconv"
"sort"
"strings"
)
func main() {
palindromes := []int{}
class Dog
def initialize(name)
@name = name
end
def to_s
"#<Dog name=#{@name}>"
end
def bark
"WOOF"
end
@maxjacobson
maxjacobson / notes.md
Created December 11, 2014 03:53
Kevin Lipe posted this on "Trapstreet" on Aug 31, 2011. It was archived in my Google Reader but I saved it because I thought it was a cool idea

Notes On A Writing Device

Here’s a brain dump of something Stephen Hackett and I were talking about yesterday. This is an idea I’ve had (and researched pretty thoroughly) since freshman year in the dorm: the ultimate tool for writing text. A “real” computer is overkill, and an iOS device, with its color LCD screen and multitude of apps, isn’t ideally suited to be a tool for writing text. What is needed is something closer to the Kindle: a (mostly) single-purpose, self-contained device with an always-on wireless connection (whether that’s through 3G like Whispernet or through WiFi) in which every facet of the design of the hardware and software is geared toward one thing: being an efficient tool for translating ideas into words. Essentially this device would be the translation of an application like Byword or TextMate into hardware.

The Hardware

The hardware would be a cross between an Alphasmart Neo and a Kindle (other antecedents include the Information Appliance Swyft and the TRS-80 Model 100: black an