Skip to content

Instantly share code, notes, and snippets.

Avatar

Keita Urashima ursm

  • Sapporo, Japan
  • Twitter @ursm
View GitHub Profile
@ursm
ursm / 0_reuse_code.js
Created May 5, 2014 21:16
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View ansible-eyc-inventory
#!/usr/bin/env ruby
require 'json'
Instance = Struct.new(:hostname, :amazon_id, :role)
def environment
basename = File.basename(__FILE__)
unless basename.include?('@')
@ursm
ursm / config.json
Created June 23, 2014 05:32
Custom bootstrap build configuration for Idoyuki
View config.json
{
"vars": {
"@gray-darker": "lighten(#000, 13.5%)",
"@gray-dark": "lighten(#000, 20%)",
"@gray": "lighten(#000, 33.5%)",
"@gray-light": "lighten(#000, 60%)",
"@gray-lighter": "lighten(#000, 93.5%)",
"@brand-primary": "#428bca",
"@brand-success": "#5cb85c",
"@brand-info": "#5bc0de",
View ditz.vim
function! s:Todo()
call s:OpenBufferFromCommand('ditz todo', function('s:IssueCallback'))
endfunction
function! s:TodoAll()
call s:OpenBufferFromCommand('ditz todo --all', function('s:IssueCallback'))
endfunction
function! s:Grep(args)
call s:OpenBufferFromCommand(printf('ditz grep "%s"', a:args), function('s:IssueCallback'))
View mercurial.rb
require 'time'
module Ditz
class Issue
def hg_commits
return @hg_commits if @hg_commits
output = `hg log --template '{date|rfc822date}\t{author}\t{node|short}\t{desc|firstline}\n' #{pathname}`
@hg_commits = output.split("\n").map {|line|
date, *vals = line.split("\t")
View hook.rb
class Ditz::HookManager
on :after_add do |project, config, issues|
issues.each do |i|
`hg add #{i.pathname}`
end
end
on :after_delete do |project, config, issues|
issues.each do |i|
`hg remove #{i.pathname}`
View async-session.coffee
`import Ember from 'ember'`
`import Session from 'simple-auth/session'`
makePromise = (promiseOrValue) ->
if promiseOrValue.then
promiseOrValue
else
Ember.RSVP.resolve(promiseOrValue)
AsyncSession = Session.extend
@ursm
ursm / systemd.md
Last active August 29, 2015 14:19
View systemd.md

kernel

# cd /usr/src/linux
# make nconfig

Gentoo Linux  --->
  Support for init systems, system and service managers  --->
    [ ] OpenRC, runit and other script based systems and managers
 [*] systemd
View 106to101.ahk
#UseHook
SetStoreCapslockMode Off
+vkF4::Send ~
vkF4::Send {``}
vkF3::Send {``}
+2::Send @
+6::Send {^}
+7::Send {&}
View activeadmin_aato_select2.rb
form do |f|
f.semantic_errors
f.inputs do
f.input :name, input_html: {disabled: true}
f.input :tag_list, as: :select2_tags, collection: ActsAsTaggableOn::Tag.pluck(:name), input_html: {value: f.object.tag_list.to_s}
end