{{ message }}

Instantly share code, notes, and snippets.

😐
Haha

# vamdtvamdt

😐
Haha
Last active Dec 21, 2015

View 关于群策工具的开发.md

# 关于群策工具的开发

## 用到的工具（非必需）

### Chrome && Chrome Plugins

Created Nov 8, 2013
View current_user.rb
 module CurrentUser def signed_in? !current_user.nil? end def sign_in(user) self.current_user, session["user_id"] = user, user.id end def sign_out
Last active May 8, 2016
View fibonacci.exs
 defmodule Fib do def fib(n) when n < 2 do n end def fib(n) when n >= 2 do fib(n-1) + fib(n-2) end
Created Jan 1, 2014
Last active Aug 29, 2015
View five_num.js
 // 拿到嵌套数组的前五个 (function(){ var first_arr = [[1,3,4], [3,4,5,6,0], [34,56,23,56,34] [32,45]];// => [[1,3,4],[3,4]] var second_arr = [[1,3,4,7], [3,4,5,6,0], [34,56,23,56,34] [32,45]]; // => [[1,3,4,7],[3]] var third_arr = [[1,3,4,7,9], [3,4,5,6,0], [34,56,23,56,34] [32,45]]; // => [[1,3,4,7,9]] var fourth_arr = [[1,3,4,7,9, 10], [3,4,5,6,0], [34,56,23,56,34] [32,45]]; // => [[1,3,4,7,9]] function five(arr) { var count = 0, result = [], left_count = 0; for (var i = 0; i <= arr.length; i++) {
Last active Aug 29, 2015

View odd_collection.js
 //数字shift1,change next to last //eg：1234567890 // =>345678902..1 // =>5678904....3 // =>789046.....5 // =>90468......7 // =>4680.......9 // =>806........4 // =>60.........8 // =>0..........6
Last active Mar 14, 2019 — forked from sumskyi/README.md
rails4 sti, custom "type" column name and value
View city.rb
 class City < GeoEntity def self.sti_name 3 end end
Created Oct 13, 2014
Add module nest to ruby class