Skip to content

Instantly share code, notes, and snippets.

View wwkeyboard's full-sized avatar
ERR_INSUFFICIENT_COFFEE

Aaron Lee wwkeyboard

ERR_INSUFFICIENT_COFFEE
View GitHub Profile
@wwkeyboard
wwkeyboard / main.rs
Created July 5, 2020 19:06
Trying to render a safe string into a askama template.
use askama::Template;
#[derive(Template)]
#[template(source = "hello {{ name | safe }}", ext = "txt")]
struct HelloTemplate<'a> {
name: &'a str,
}
fn main() {
let hello = HelloTemplate { name: "world" };
@wwkeyboard
wwkeyboard / bad.py
Created June 21, 2018 13:18
Runtime error that would be caught by a static type system
def foo(a):
if a['b'] > 1:
print("here")
def bar(a, b):
a['b'] = b
b = {}
bar(b, 2)
@wwkeyboard
wwkeyboard / gist:1b70d6a70af919385015
Last active August 29, 2015 14:21
Books on software engineering
@wwkeyboard
wwkeyboard / models.rb
Created May 13, 2015 20:11
questions thinking
class Question < ActiveRecord::Base
end
class Answer < ActiveRecord::Base
end
package main
/*
* TODOs:
* - Should pass the rune into the stateFn, to avoid all of the backups
*/
import (
"fmt"
"io/ioutil"
@wwkeyboard
wwkeyboard / haste-boot.log
Created September 27, 2014 14:36
Booting haste
$ haste-boot --local &> haste-boot.log
Reading package info from "libraries/rts.pkg" ... done.
Resolving dependencies...
Configuring ghc-prim-0.3.0.0...
Building ghc-prim-0.3.0.0...
Preprocessing library ghc-prim-0.3.0.0...
hastec: setNumCapabilities: not supported in the non-threaded RTS
WARNING: Unsupported PrimOp: indexCharOffAddr#
WARNING: Unsupported PrimOp: indexCharOffAddr#
WARNING: Unsupported PrimOp: indexCharOffAddr#
@wwkeyboard
wwkeyboard / coresbuster
Created June 23, 2014 20:53
I'm very sorry for this :(
function getKeys(username) {
return $.getJSON("https://github.com/" + username + ".keys");
}
alert("here");
@wwkeyboard
wwkeyboard / cards.hs
Created February 4, 2014 12:28
Trying to model playing cards in Haskell(not sure this is right)
-- | Main entry point to the application.
module Main where
data Suit = Hearts | Dimonds | Clubs | Spades
data Rank = A | R2 | R3 | R4 | R5 | R6 | R7 | R8 | R9 | R10 | J | Q | K
data Card = Card Rank Suit
rankWord :: Rank -> String
rankWord A = "Ace"
rankWord R2 = "Two"
ruby -r 'json' -r 'rest-client' -e "[JSON.parse(RestClient.get \"http://www.reddit.com/r/dadjokes.json\")['data']['children'].sample['data']].map{|j| puts \"#{j['title']} \n #{j['selftext']}\" }"
@wwkeyboard
wwkeyboard / player.rb
Created September 25, 2012 00:17
Player from the 9/24 class
class Player
attr_accessor :warrior
def initialize
@old_health = 20
end
def play_turn(warrior)
@warrior = warrior