View sugu-play.sh
#!/bin/bash
# ./play-bootstrap.sh -a app_name -s 2.11.7 -p 2.5.9
usage_exit() {
echo "Usage: $0 [-a application name] [-s scala version] [-p play version]" 1>&2
exit 1
}
while getopts p:a:s:b:h OPT
View xcode-app-required.rb
#/usr/bin/env ruby
require 'json'
JSON.parse(`brew info --json=v1 --installed`)
.select { |formula|
formula["requirements"].any? { |req| req["name"].downcase == "xcode" }
}
.each { |formula|
puts formula["name"]
View setuidgid-on-alpine.md

setusergroups

Dockerfile:

RUN apk add --no-cache --virtual .setusergroups-buildeps abuild build-base git autoconf automake && \
    git clone https://github.com/tokuhirom/setusergroups.git /opt/setusergroups && \
    (cd /opt/setusergroups && autoreconf -i && ./configure && make && make install) && \
    rm -r /opt/setusergroups && \
    apk del .setusergroups-buildeps
View boostrap.sh
# https://github.com/why-jay/osx-init/blob/master/install.sh#L25-L33
touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress;
PROD=$(softwareupdate -l |
grep "\*.*Command Line" |
head -n 1 | awk -F"*" '{print $2}' |
sed -e 's/^ *//' |
tr -d '\n')
softwareupdate -i "$PROD" -v;
git clone git@github.com:ToQoz/dotfiles.git ~/_dev/github.com/ToQoz/dotfiles
View active_record_self_diff.rb
# class User < ActiveRecord::Base
# include ActiveRecordSelfDiff
# end
#
# u = User.create(name: "toqoz")
# u.name = "toqoz-2"
# u.self_diff
# => {"name" => #<struct Struct::Diff old="toqoz", now="toqoz-2">}
module ActiveRecordSelfDiff
View memmysql5.7.sql
SELECT
data.GLOBAL_BUFFER_SIZE,
data.THREAD_BUFFER_SIZE,
data.MAX_CONNECTIONS,
GLOBAL_BUFFER_SIZE + THREAD_BUFFER_SIZE * data.MAX_CONNECTIONS AS TOTAL_MEMORY_SIZE,
(GLOBAL_BUFFER_SIZE + THREAD_BUFFER_SIZE * data.MAX_CONNECTIONS)/1024 AS TOTAL_MEMORY_SIZE_KB,
(GLOBAL_BUFFER_SIZE + THREAD_BUFFER_SIZE * data.MAX_CONNECTIONS)/1024/1024 AS TOTAL_MEMORY_SIZE_MB,
(GLOBAL_BUFFER_SIZE + THREAD_BUFFER_SIZE * data.MAX_CONNECTIONS)/1024/1024/1024 AS TOTAL_MEMORY_SIZE_GB
FROM (
(
View npub
#!/bin/sh
set -e
npm_version() {
node -e 'console.log(require("./package.json").version)'
}
if [ ! -f ./package.json ]; then
echo "package.json is not found" >> /dev/stderr
View kinesis.md

キーリマップ

  • Alt, Command の位置関係が元使っていたのとなんとなく似てるようにしたい
  • Alt, Command, Space はどっちの手でも打ちたい
  • 使わないキー(Home/End/Page Up/Page Down/Delete/Back Space) は他の当てたい

したやつ

Shift/Command/Alt あたりはできるだけ左右対称にしたい。

View unlock-galaxy-nexus
#!/bin/sh
# Unlock docomo NEXT series GALAXY NEXUS SC-04D SC-04D's sim
set -e
adb-reboot() {
adb reboot
adb wait-for-device
echo "rebooted!" >> /dev/stderr
View aws.js
indexer = {
id: 'aws',
icon: 'https://a0.awsstatic.com/main/images/logos/aws_logo_mobile@2x.png',
name: 'AWS',
index: function(ctx) {
return ctx
.fetchDocument('http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/_index.html', {
srcdoc: true
})
.then(function(document) {