myfunction(item) for item in items- GitHub Staff
- https://bento.me/kyanny
- @kyanny
- in/kyanny
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # app/models/my_model.rb | |
| module MyApp | |
| module Model | |
| def self.included(base) | |
| base.send :include, Mongoid::Document | |
| base.send :include, Mongoid::Timestamps | |
| base.send :include, ActiveAdmin::Mongoid::Patches | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'bundler/setup' | |
| require 'gollum/frontend/app' | |
| Precious::App.set(:gollum_path, File.dirname(__FILE__)) | |
| Precious::App.set(:wiki_options, {}) | |
| run Precious::App |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Install instructions for 10.2: | |
| http://download.oracle.com/docs/cd/B19306_01/relnotes.102/b15666/toc.htm | |
| http://download.oracle.com/docs/cd/B19306_01/install.102/b15667/toc.htm | |
| [Required files] | |
| 10201_database_linux_x86_64.cpio.gz | |
| 10201_companion_linux_x86_64.cpio.gz | |
| p6810189_10204_Linux-x86-64.zip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'uri' | |
| require 'net/http' | |
| class Chunked | |
| def initialize(data, chunk_size) | |
| @size = chunk_size | |
| if data.respond_to? :read | |
| @file = data | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $: << 'lib' | |
| require 'rubygems' | |
| require 'gollum' | |
| require 'gollum/frontend/app' | |
| use Rack::ShowExceptions | |
| Precious::App.set(:gollum_path, Dir.pwd) | |
| Precious::App.set(:wiki_options, {}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // I mean, seriously, localStorage is supported even by your mum. How about instead of | |
| // casing the feature out, you give users in-memory (stale) storage instead? | |
| // If they close your application, they deserve to lose data anyway. | |
| // if (!('localStorage' in window)) { | |
| if (!Modernizr.localstorage) { | |
| window.localStorage = { | |
| _data : {}, | |
| setItem : function(id, val) { return this._data[id] = String(val); }, | |
| getItem : function(id) { return this._data.hasOwnProperty(id) ? this._data[id] : undefined; }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // 1. depjobnameで指定したジョブよりも自分自身が先にキューに入った場合は、自分自身のビルドを即実行する。 | |
| // 2. depjobnameで指定したジョブよりも自分自身が後にキューに入った場合は、depjobnameの終了を待つ。 | |
| // 2-1. ポーリング方式で終了を待つ | |
| // 2-2. 最大リトライ回数は retrycount で指定 | |
| // 2-3. リトライ間隔は sleeptime で指定(単位はミリ秒) | |
| // 3. depjobnameで指定したジョブが存在しなかった場合は、ビルドを失敗させるためにあえて例外が発生する | |
| // ようにしています。 | |
| // 4. 設定手順 | |
| // 4-1. Groovy Pluginをインストールする |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/ruby | |
| # | |
| # ldr2pin.rb - Livedoor ReaderのPinをまとめてpinboard.inにブックマークするスクリプト | |
| # | |
| $KCODE='utf8' | |
| require 'rubygems' | |
| require 'net/netrc' | |
| require 'mechanize' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| syntax "gitcommit" "COMMIT_EDITMSG$" | |
| color white "#.*" | |
| color green "#.(modified|deleted).*" | |
| color yellow start="# Changes.*" end="# Changed.*" | |
| color cyan start="# Untracked.*" end="diff" | |
| color cyan start="# Untracked.*" end="$$" | |
| color brightred "^deleted file mode .*" | |
| color brightgreen "^\+.*" | |
| color brightred "^-.*" | |
| color brightyellow "^(diff|index|---|\+\+\+).*" |