Skip to content

Instantly share code, notes, and snippets.

View godfat's full-sized avatar

Lin Jen-Shin (godfat) godfat

View GitHub Profile
require 'rspec'
RSpec.describe do
class InnerClass
end
end
p Object.const_defined?(:InnerClass) # true

https://blog.whereislee.org/2017/04/108

李明哲妻李凈瑜回覆國台辦聲明

Lee Ching-yu, the wife of Lee Ming-che, replies to the PRC’s Taiwan Affairs Office

(如需英文版本請轉到文章下方, please refer to bottom for english version.)

20170409

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#IfWinActive, ahk_class ArenaNet_Dx_Window_Class
#MaxThreadsPerHotkey 2
Toggle = 0
F9::

Architecture of GitLab as an Open Source Project

In this talk I'll briefly explain how GitLab was composed from different components, and what do each different components do, and how I contribute to GitLab. If you would also like to contribute to GitLab, then you'll certainly need to know where you need to get started for the contribution you want to make. This talk would be a nice introduction for you. If you are just interested in large software architecture in general, then this should also be interesting for you.

Outline

  • Who am I
  • Introduction to GitLab
    • What is GitLab
  • GitLab.com
shared_context 'C0' do
let(:c0) { 0 }
end
shared_context 'C1' do
let(:c1) { 1 }
end
describe 'D0' do
include_context 'C0'
@godfat
godfat / closure-trick.go
Created May 27, 2016 09:49
the same closure trick in go
package main
import "fmt"
func main() {
var a [5]func() int
for i:=0; i < 5; i++ {
a[i] = func(ii int) func() int {
return func() int {
return ii
@godfat
godfat / rails
Created April 26, 2016 19:20
minimal rails app
require 'rails'
require 'logger'
APP_PATH = 'rails'
root = File.expand_path("#{__dir__}/..")
config = Rails::Application::Configuration.new
config.root = root
app = Class.new(Struct.new(:root, :config)) do
def call _
require 'representable/json'
Representable.deprecations = false
class UserRepr < Representable::Decorator
include Representable::JSON
property :name
end
簡單地說就是一個假想的世界的狀態,
每一次做了有 side-effect 的事情時,
我們就說這個世界有了一點改變。
我們不知道是什麼改變,因為我們不能偷窺這個世界,
那只是一個黑盒子表示有東西變了,
並把新的世界傳遞下去,強迫每一次改變都是從
最後一次改變的世界中再做改變。
但實際上我們並不需要真的紀錄這個黑盒子,
因為反正我們根本不會去看,或是說,
先貼連結,大概就是講這個,依照上面的 source 順序講
http://okmij.org/ftp/tagless-final/course/optimizations.html#PPL2015
我這邊只講大意,主要還是要看 source 裡面寫的東西,
會比我描述的清楚許多
首先是在 http://okmij.org/ftp/tagless-final/course/BasicGates.hs
裡面定義基本的語言:
class Symantics repr where 那段
實作這個語言的部份則是: