Skip to content

Instantly share code, notes, and snippets.

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

nof

🏠
Working from home
  • SonicGarden
  • Hiroshima, Japan
  • X @ssh_nof
View GitHub Profile
require 'logger'
class TmpLog
def write(message)
logger.info(message)
end
private
def logger
@nof
nof / 2factor.rb
Last active August 29, 2015 14:17
require 'uri'
require 'rotp'
require 'rqrcode_png'
key = ROTP::Base32.random_base32
totp = ROTP::TOTP.new(key)
uri = totp.provisioning_uri('hoge@hoge.com')
puts "key:#{key} uri:#{uri}"
@nof
nof / excellent.swift
Created March 4, 2015 14:07
tap in swift (Dollar)
func excellent() {
let initSize = {
$0.width = self.width
$0.height = self.height
}
let haha = $.tap(Haha(), initSize)
let hoho = $.tap(Hoho(), initSize)
}
@nof
nof / good.swift
Created March 4, 2015 14:07
tap in swift (Dollar)
func good() {
let haha = $.tap(Haha()) {
$0.width = self.width
$0.height = self.height
}
let hoho = $.tap(Hoho()) {
$0.width = self.width
$0.height = self.height
}
}
@nof
nof / poor.swift
Created March 4, 2015 14:05
tap in swift (Dollar)
func poor() {
let haha = Haha()
haha.width = self.width
haha.height = self.height
let hoho = Hoho()
hoho.width = self.width
hoho.height = self.height
}
@nof
nof / 2letter.rb
Created February 26, 2015 03:15
find 2letter domain
require 'whois'
domain = 'gy'
puts ('aa'..'zz').map { |name| "#{name}.#{domain}" }
.reject { |fqdn| sleep 0.5; Whois.registered? fqdn }
2014-11-27 18:46:26 +0900
./configure
--prefix=/usr/local/Cellar/octave/3.8.1
--disable-docs
--disable-gui
--without-opengl
--with-x=no
checking for a BSD-compatible install... /usr/bin/install -c
2014-11-27 18:02:11 +0900
./configure
--prefix=/usr/local/Cellar/octave/3.8.1
--without-opengl
--with-x=no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... build-aux/install-sh -c -d