Skip to content

Instantly share code, notes, and snippets.

View yukihr's full-sized avatar
🏠
Working from home

yukihiro hara yukihr

🏠
Working from home
View GitHub Profile
@yukihr
yukihr / 0_reuse_code.js
Created November 20, 2015 15:31
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@yukihr
yukihr / shinchoku.coffee
Last active August 29, 2015 13:56
進捗どうですか? on Hubot
# put in scripts/shinchoku.coffee
# add "tumblr": "~0.4.0" on package.json -> "dependencies"
tumblr = require 'tumblr'
util = require 'util'
auth =
# Set these on environment variables
consumer_key: process.env['TUMBLR_CONSUMER_KEY']
consumer_secret: process.env['TUBMLR_CONSUMER_SECRET']
token: process.env['TUMBLR_TOKEN']
@yukihr
yukihr / find-outdated-docs.sh
Last active January 2, 2016 17:19
find out dated files for enja-oss/stylus
#!/bin/bash
ORIG_DIR='./stylus_orig'
CLONE_TO='git clone https://github.com/LearnBoost/stylus.git'
LIST_DOCS='git ls-tree --name-only HEAD docs/'
LAST_TIME='git log -1 --pretty=format:%ct'
LAST_TIME_F='git log -1 --pretty=format:%cr'
DEV=false
${CLONE_TO} ${ORIG_DIR} > /dev/null 2>&1
@yukihr
yukihr / bifs.diff
Last active January 2, 2016 16:29
enja-oss/stylus out dated files(2013-1-9)
diff --git a/docs/bifs.md b/docs/bifs.md
index 57a6c5c..9f420ad 100644
--- a/docs/bifs.md
+++ b/docs/bifs.md
@@ -19,7 +19,7 @@ Return the green component of the given `color`.
Return the blue component of the given `color`.
- red(#00c)
+ blue(#00c)
@yukihr
yukihr / Gemfile
Last active December 31, 2015 20:39
test for rails-sass-source-maps
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
@yukihr
yukihr / Vagrantfile
Last active December 27, 2015 11:09
Conf file for hosting yukihr.github.io/fjord_intern on Debian wheezy on VirtualBox with nginx.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "wheezy"
カレーのレシピ
誰でもできる、美味しいカレーの作り方です。旦那も息子もこのカレーが大好物。
ポイントは玉ねぎと人参はミキサーで細かくしてしまうところ。逆にコクのある美味しいカレーになります。
レシピの作者
山田サチ子さん
材料 ( 8皿分 )
@yukihr
yukihr / subscribeFeedlyBookmarklet.js
Created September 12, 2013 21:24
SubscribeFeedly Bookmarklet Source
// Compile with:
// http://subsimple.com/bookmarklets/jsbuilder.htm
(function(w) {
var r, i, u, t,
l = document.getElementsByTagName('link'),
ll = l.length;
for(i=0; i<ll; i++) {
if(l[i].getAttribute('rel') === 'alternate'
@yukihr
yukihr / list_template_methods.html.erb
Last active March 18, 2017 19:19
List Middleman helper methods/variables available in templates.
<% all_methods = self.class.superclass.instance_methods - self.class.superclass.superclass.instance_methods %>
<% output_helpers = ::Padrino::Helpers::OutputHelpers.instance_methods %>
<% tag_helpers = ::Padrino::Helpers::TagHelpers.instance_methods %>
<% asset_tag_helpers = ::Padrino::Helpers::AssetTagHelpers.instance_methods %>
<% form_helpers = ::Padrino::Helpers::FormHelpers.instance_methods %>
<% render_helpers = ::Padrino::Helpers::RenderHelpers.instance_methods %>
<% number_helpers = ::Padrino::Helpers::NumberHelpers.instance_methods %>
<% blog_helpers = Middleman::Blog::Helpers.instance_methods %>
<% mm_methods = all_methods - output_helpers - tag_helpers - asset_tag_helpers - form_helpers - render_helpers - number_helpers %>
@yukihr
yukihr / erb2slim.rake
Last active December 18, 2015 04:39
Rake Task to convert ERB to Slim using html2slim gem.
# Rake convert:erb2:slim converts every ERB files under `/app/views/**`.
# Original ERB files will be kept otherwise `delete` option is passed like:
# `$ rake "convert:erb2:slim[delete]"` .
namespace :convert do
namespace :erb2 do
ERBS = FileList["#{Rails.root}/app/views/**/*.erb"]
### Slim
require 'html2slim'
# generate tasks for slim files