Skip to content

Instantly share code, notes, and snippets.

View ssov's full-sized avatar

SHIMANUKI Toshiyuki ssov

View GitHub Profile
// ==UserScript==
// @name Hide tweets liked by others
// @namespace https://github.com/ssov
// @version 0.1
// @description This script hides tweets liked by others
// @author ssov
// @match https://twitter.com/home
// @include https://twitter.com/i/lists/*
// @grant none
// ==/UserScript==
@ssov
ssov / pr500ki.sh
Created July 23, 2015 16:28
グローバルIPを生成し直す in PR500KI
#!/bin/sh -e
ID='username'
PW='password'
IP='PR500KI_IP_ADDR'
SESSION_ID=1
dig +short myip.opendns.com @resolver1.opendns.com
TOKEN=$(curl -s -c /tmp/cookie "http://${ID}:${PW}@${IP}/ntt/basic/v4pppoe" \
| awk 'match($0, /[0-9a-f]{32}/) { print substr($0, RSTART, RLENGTH) }')
@ssov
ssov / unko.rb
Created February 21, 2014 03:02
require 'stringio'
require 'csv'
str = StringIO.new(IO.read("SIKS*********.csv")).read.gsub(/\r/, '')
parse = CSV.parse(str)
parse.shift
sum = 0.0
a = 0.0
parse.each do |row|
@ssov
ssov / recipe-test
Created December 27, 2013 08:01
test recipe
cd ~/
touch test-test-test
@ssov
ssov / recipes
Last active January 1, 2016 12:19
test https://gist.github.com/ssov/8143926/raw/2be6ba545db7552985d998fd98c5fc22ad5763db/recipe-test
@ssov
ssov / unko.rb
Last active December 30, 2015 00:18
テストケース2で死亡
n, d = gets.chomp.split(" ").map{|i| i.to_i}
values = []
n.times{ values << gets.chomp.to_i }
combinations = values.combination(2).to_a.map{|i| i.inject(:+)}
d.times{
i = gets.chomp.to_i
m = combinations.select{|j| (i-j) >= 0}.max
puts m.nil? ? 0 : m
}

OSX10.9 かつ *MacBookAir(Mid2013)*でコンパイルを通す方法です.

homebrewがインストールされている前提です.


手順

  1. Xcodeをアップデートする
  2. (必要に応じて) $ brew tap homebrew/versions
  3. $ brew install gcc48 または brew reinstall gcc48
    • reinstallが上手く行かない場合は, エラーメッセージに書かれているブツをreinstall
  4. $ brew install gcc48
@ssov
ssov / gist:7130647
Created October 24, 2013 03:05
壁紙をランダムにチェンジ。デュアルモニタに対応。
# coding: utf-8
landscape = Dir.glob("#{File.expand_path("~")}/dotfiles/background/landscape/*.jpg")
portrait = Dir.glob("#{File.expand_path("~")}/dotfiles/background/portrait/*.jpg")
puts "feh --bg-fill #{landscape.shuffle.first} #{portrait.shuffle.first}"