Skip to content

Instantly share code, notes, and snippets.

View evie404's full-sized avatar

Evelyn Pai evie404

View GitHub Profile
@evie404
evie404 / gist:cbbc5f23b1f7a3a99043
Created January 23, 2015 11:00
十萬個為什麼
十萬 = 100_000
class Fixnum
def 個
times.map { yield }
end
end
puts 十萬.個 { "為什麼" }
@evie404
evie404 / love_testing
Last active August 29, 2015 14:25
How I Learned to Love Testing
Better Testing in Ruby (or "How I Learned to Love Testing")
==============================
Introduction:
- Ricky
- Software Engineering @ Airbnb (Previous: Twitter, Aniarc)
Beginning:
- "I wrote the code, I already know it works!"
@evie404
evie404 / wtf.rb
Created February 22, 2016 23:23
wtf ruby
class Lol
def initialize(some_array)
@some_array = some_array
end
def lol
puts some_array.inspect # returns value
some_array += [1] # undefined method `+' for nil:NilClass (NoMethodError)
end
$$$$$c_shit_mutex = Mutex.new
class RunStuffAsyncPoolBigData
def run
Thread.new do
$$$$$c_shit_mutex.synchronize { c_shit }
run_only_thread_safe_shit_in_here_yo
end
end
@evie404
evie404 / server.py
Last active September 14, 2016 00:07 — forked from ibeex/foo.log
Flask logging example
import logging
from logging.handlers import RotatingFileHandler
from flask import Flask
app = Flask(__name__)
@app.route('/')
def foo():
paifor x in range(0, 3):
go
build-essentials
mercuial
docker
etcd
apiVersion: v1
kind: Pod
metadata:
labels:
test: liveness
name: liveness-localhost
namespace: cluster-tests
spec:
containers:
- name: liveness
@evie404
evie404 / wtf.rb
Last active December 16, 2017 00:26
wtf
# frozen_string_literal: true
module FooFile
class Processor
def self.from_file(file)
new(File.read(file))
end
def initialize(raw)
@raw = raw
@evie404
evie404 / interview.go
Last active May 1, 2018 17:11
interview snipplet
package main
import "fmt"
func plusone(a int) int {
return a + 1
}
type testCase struct {
input int