Skip to content

Instantly share code, notes, and snippets.

View wildjcrt's full-sized avatar
🦀
have a nice day!

Jerry Lee wildjcrt

🦀
have a nice day!
View GitHub Profile
# Env: Mac + zsh shell
# Fix git-flow and tig completion
# setup .zshrc
$ vim ~/.zshrc
# plugins=(git git-flow tig history-substring-search rvm z)
$ brew install git
$ cd /usr/local/share/zsh/site-functions
$ unlink git-completion.bash && ln -s ../../../Cellar/git/x.x.x/etc/bash_completion.d/git-completion.bash
@wildjcrt
wildjcrt / README.md
Last active June 23, 2018 07:17
Caller's Bane 遊戲簡介與中文自架說明

由於這是一款我很喜歡的卡牌+SLG 遊戲,最近 free 了所以來寫篇簡介,以及說明怎麼安裝。

更新時間: 20180623

Caller's Bane (也就是之前的 Scrolls)

遊戲玩法可以看這裡,我覺得教學模式挺完善的,可以直接開 Arena 把 Tutorial 打完大概就會了。後面還有很多關卡可以挑戰,也可以 pvp,我自己是覺得電腦還挺強。

遊戲閃光點

# gem install twitter
require 'twitter'
# https://apps.twitter.com/
client = Twitter::REST::Client.new do |config|
config.consumer_key = "...."
config.consumer_secret = "...."
end
def collect_with_max_id(collection=[], max_id=nil, &block)
require 'benchmark/ips'
require 'date'
Benchmark.ips do |x|
x.time = 100
x.report('Time') do
Time.now.year
end
// dependencies
var async = require('async');
var path = require('path');
var AWS = require('aws-sdk');
var gm = require('gm')
.subClass({ imageMagick: true }); // Enable ImageMagick integration.
var util = require('util');
// constants
var MAX_WIDTH = 640;
require 'sequel'
module FasterSequelTimeParser # from activerecord
module_function
def parse string
string =~ /\A(\d{4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)(\.\d+)?\z/
microsec = ($7.to_r * 1_000_000).to_i
::Time.utc($1.to_i, $2.to_i, $3.to_i, $4.to_i,
$5.to_i, $6.to_i, microsec)
end
Rails.application.config.after_initialize do
ActiveSupport.on_load(:active_record) do
oid = ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::OID
# https://github.com/rails/rails/blob/v4.2.3/activerecord/lib/active_record/connection_adapters/postgresql/oid/jsonb.rb
oid::Jsonb = Class.new(oid::Json) do
def type
:jsonb
end
@tka
tka / benchmark.rb
Last active August 29, 2015 14:24
golang 1.5 shared library + ruby ffi
# 搭配 http://qiita.com/yanolab/items/1e0dd7fd27f19f697285 服用
require 'ffi'
require 'benchmark'
module LibGo
extend FFI::Library
ffi_lib './libgo.so'
attach_function :fib, [:int], :int