Skip to content

Instantly share code, notes, and snippets.

View tobynet's full-sized avatar

tobynet tobynet

  • Toyama, Japan
View GitHub Profile
#!/usr/bin/env ruby
require 'octokit'
def usage
puts <<USAGE
Usage: #{File.basename($0)} [user/repo] ref
#{File.basename($0)} defunkt/hub master
#{File.basename($0)} feature # branch name only
USAGE
let s:endpoint = 'http://services.gingersoftware.com/Ginger/correct/json/GingerTheText'
let s:apikey = '6ae0c3a0-afdc-4532-a810-82ded0054236'
function! s:ginger(text)
let res = webapi#json#decode(webapi#http#get(s:endpoint, {
\ 'lang': 'US',
\ 'clientVersion': '2.0',
\ 'apiKey': s:apikey,
\ 'text': a:text}).content)
let i = 0
let correct = ''
@zemlanin
zemlanin / fonts.conf
Last active December 15, 2015 20:49 — forked from robotslave/gist:4633393
Emoji in Ubuntu
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<!--
1. Download the Symbola font:
http://users.teilar.gr/~g1951d/Symbola707.zip
2. unzip the file and put Symbola.ttf (and any of the other fonts that strike your fancy)
in your ~/.fonts/ directory
3. run `fc-cache -f`. You can check to make sure the new fonts
メモ
全体的なこと
- 想定してるRubyとかRailsのバージョンが古いので何とかしたい。
- 個人的に改造してる人がそれなりにいるので、その辺まとめたい。
- github/livedoor もあるんだけど、そこにadmin権限持ってるユーザー好き勝手追加は怖いので別で + コミュニティ主導でやりたい
- html/js/css も割と古くなってしまっているので、そのへんも何とかしたい。
----
オープンソースに拘るのは保険的な意味合いもあるのだけど、
サービス型のRSSリーダーで出来無いことがそれなりにあるというのが大きい。
@mala
mala / gist:5108900
Created March 7, 2013 15:38
攻撃者が生パスワードまず復元できないだろという状況でも全ユーザーのパスワードリセットしたほうが良い10の理由

Evernoteの話ですけど。「強固なパスワード暗号化技術を採用」していて、攻撃者がまず生パスワード復元できないだろう、という状況であっても、パスワードリセットはしたほうがいい。

2011年のLastpassのケースでは、強固なパスワード使っている人は大丈夫だけど、そうじゃない場合はブルートフォースでマスターパスワード取得されうるということを発表していた。これはハッシュ値生成のアルゴリズムが、既知 or 推測しやすい or ソースコードも含めて漏洩している、という時にこの状態になる。

"If you have a strong, non-dictionary based password or pass phrase, this shouldn't impact you - the potential threat here is brute forcing your master password using dictionary words, then going to LastPass with that password to get your data. Unfortunately not everyone picks a master password that's immune to brute forcing."

で、Evernoteのケースは「弊社は強固なパスワード暗号化技術を採用しておりますが」と言っている。

#!/bin/sh
set -e
image=/tmp/sl63.img
root_dir=/tmp/root
truncate -s 5368709120 $image
@tommynyquist
tommynyquist / fuzzy_public_suffix_list_matching.py
Last active December 13, 2015 21:59
Example fuzzy Public Suffix List matching
def parse(domain, psl):
fuzzy_hosts = ('www', 'mobile', 'm')
domain_parts = domain.split('.')
if domain_parts[0] in fuzzy_hosts:
domain_parts = domain_parts[1:]
if '.'.join(domain_parts[1:]) in psl:
return sorted(['.'.join(domain_parts)] + \
['.'.join([fuzzy_host] + domain_parts) for fuzzy_host in fuzzy_hosts])
else:
return sorted([domain])
@naohaq
naohaq / quicksort.txt
Last active December 12, 2015 03:09
procedure quicksort(A,M,N); value M,N;
array A; integer M,N;
begin integer I,J;
if M < N then begin partition(A,M,N,I,J);
quicksort(A,M,J);
quicksort(A,I,N);
end
end quicksort
@siyo
siyo / honki_dase.rb
Last active December 12, 2015 02:09
# -*- coding: utf-8 -*-
# honki dase plugin
#
# e.g.:
# event registration from tweet
# $ 20:00に本気だす
#
require 'time'
Earthquake.init do
#!/usr/bin/env sh
if ! which md5sum > /dev/null; then
echo Install md5sum
exit 1
fi
if ! which curl > /dev/null; then
echo Install curl
exit 1