git config --global init.templatedir '~/.git-templates'
mkdir -p ~/.git-templates/hooks
-
create ~/.tig-brother/checkouts.db (sqlite3) from the dump
-
copy the hook script
-
git init
in the git repo
require 'mechanize' | |
require 'kuromoji' | |
dom = Mechanize.new.get("http://tatoeba.org/eng/sentences/show/jpn") | |
jp_sentence = dom.parser.at("//div[@lang = 'ja']").text | |
# => "万一に備えて傘を持っていった方がいいだろうな。" | |
jp_sentence_w_furigana = dom.parser.at("//div[@lang = 'ja-Latn']").text | |
# => "万一[まんいち] に[] 備え[そなえ] て[] 傘[かさ] を[] 持っ[もっ] て[] いっ[] た[] 方[ほう] が[] いい[] だろ[] う[] な[] 。[]" | |
en_sentence = dom.parser.at("//div[@lang = 'en']").text | |
# => "Perhaps I should take an umbrella with me just in case." |
class InstagramRealTimeUpdatesController < ActionController::Base | |
def callback | |
case request.method_symbol | |
when :get | |
render text: Instagram.meet_challenge(params, ENV['INSTAGRAM_VERIFY_TOKEN']) | |
when :post | |
Instagram.process_subscription(request.body.read) do |handler| | |
handler.on_user_changed do |user_id, data| | |
media_id = (data['data'] || {})['media_id'] | |
InstagramJob.perform_later user_id, media_id |
git config --global init.templatedir '~/.git-templates'
mkdir -p ~/.git-templates/hooks
create ~/.tig-brother/checkouts.db (sqlite3) from the dump
copy the hook script
git init
in the git repo
#!/usr/bin/env ruby | |
require 'wanikani' | |
Wanikani.api_key = 'YOUR_WANIKANI_API_KEY' | |
wanikani_kanji_data = Wanikani::Level.kanji(*(1..60)) | |
def color_for(item) | |
case (item['user_specific'] || {})['srs'] | |
when 'apprentice' then '#dd0093' |
- - "お前" | |
- :count: 325 | |
:readings: | |
- "オマエ" | |
- - "木" | |
- :count: 285 | |
:readings: | |
- "キ" | |
- - "言う" | |
- :count: 279 |
#!/usr/bin/env ruby | |
require 'yaml' | |
require 'mojinizer' | |
text = STDIN.read | |
kanjidb = YAML.load_file('kanji_levels.yml') | |
kanji = text.chars.select { |ch| ch.kanji? }.uniq |
COUNTRIES_WITHOUT_POSTCODES = [ | |
[ "Angola", "AO" ], | |
[ "Antigua and Barbuda", "AG" ], | |
[ "Aruba", "AW" ], | |
[ "Bahamas", "BS" ], | |
[ "Belize", "BZ" ], | |
[ "Benin", "BJ" ], | |
[ "Botswana", "BW" ], | |
[ "Burkina Faso", "BF" ], | |
[ "Burundi", "BI" ], |
#!/bin/bash | |
# usage: critical_hit HIPCHAT_API_KEY HIPCHAT_USER_ID_OR_EMAIL | |
(./set_hipchat_status $1 $2 dnd; sleep 2h; ./set_hipchat_status $1 $2 chat) & |
Leimi's note: removed lots of stuff from the original gist of scottjl, (thanks to him by the way!), as in the end some wasn't useful for me. If you are intestered, go check the gist revisions.
The KC60 is kinda like a premade GH60 that was first sold on Massdrop during summer 2015.
It runs on TMK firmware, or something based on it at least (not sure this is the real source for the keyboard but it seems it is), which means it's heavily programmable.
There is a GUI tool (the source of this tool seems to be here) and a command-line tool to ease up the process of programming the board.
**Go check this great article on Key
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"