Skip to content

Instantly share code, notes, and snippets.

tr = log --graph --all --format=\"%x09%C(cyan bold)%an%Creset%x09%C(yellow)%h%Creset %C(magenta reverse)%d%Creset %s\"
@shunsugai
shunsugai / init.el
Created June 3, 2014 15:22
emacs settings
;;
;; init.el
;;
;; -*- mode: emacs-lisp; coding: utf-8; indent-tabs-mode: nil -*-
;; Language
(set-language-environment 'Japanese)
;; Set alt as Meta key
@shunsugai
shunsugai / perm.go
Created December 25, 2014 14:59
Decrypt gesture.key with Golang.
package main
import (
"fmt"
"github.com/kokardy/listing"
"runtime"
"sync"
)
func main() {
@shunsugai
shunsugai / read-fingerprint-service.txt
Created June 29, 2015 12:52
FingerprintServiceを読んで気になったこと
http://tools.oesf.biz/android-MNC/xref/com/android/server/fingerprint/FingerprintService.java
=====
532 @Override
533 // Binder call
534 public void authenticate(final IBinder token, final long opId, final int groupId,
535 final IFingerprintServiceReceiver receiver, final int flags, String opPackageName) {
536 checkPermission(USE_FINGERPRINT);
537 if (!canUserFingerPrint(opPackageName)) {
538 return;
539 }
@shunsugai
shunsugai / compare.rb
Created September 25, 2011 15:58
Test.
#encoding: utf-8
class String
def make_ngram(n)
ary = self.split(//)
ngram_ary = []
p = ary.length
for i in 0..(p - n) do
ngram_ary << ary[i...(i + n)]
end
class Foo
def self.foo(method)
define_method(method) do
puts "Foo##{method} called."
end
end
foo :bar
foo :baz
end
class Bar
class << self
def self.bar(method)
define_method(method) do
puts "Bar.#{method} called."
end
end
bar :foo
bar :baz
#tweetから記事リンクがあるものだけを取得する。
#coding utf-8
require 'twitter'
require 'net/http'
require 'uri'
class LinkGrabber
def initialize(user)
@shunsugai
shunsugai / check_rss.rb
Created July 19, 2012 01:42
RSSがWellformedかどうかを調べる
#coding: UTF-8
require 'rss'
class RSSChecker
def initialize
@blogs =
[
"http://lifehack2ch.livedoor.biz/index.rdf",
"http://www.scienceplus2ch.com/index.rdf",
"http://blog.livedoor.jp/domesaka/index.rdf",
@shunsugai
shunsugai / sample.xml
Created July 25, 2012 15:46
samplexml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="sample">
<item>FOO</item>
<item>BAR</item>
<item>BAZ</item>
</string-array>
</resources>