Skip to content

Instantly share code, notes, and snippets.

View osak's full-sized avatar

Osamu Koga (osa_k) osak

View GitHub Profile
Plugin.create(:sakuratrick) do
command(
:sakuratrick,
name: '桜Trick',
condition: lambda{|_| true},
visible: true,
role: :timeline
) do
Service.primary.post(:message => "桜Trick(#{Time.now.strftime("%H:%M")})")
end
@osak
osak / gist:37a9a9e99f7f63ed11c2
Last active August 29, 2015 14:03
クソ広告
http://ad.smaad.jp/redirectMarket.php?r=http%3A%2F%2Fapp-adforce.jp%2Fad%2Fp%2Fr%3F_site%3D11747%26_article%3D71660%26_link%3D1861004%26_image%3D1861004%26suid%3Ddb3400c900ec983ffac150d5ff3ed009%26sad%3D52078863
挙動:
1. Pixivを普通に閲覧していると、ページの読み込みを失敗した云々というconfirmが出る(ただし発行元がpixivではない怪しいドメイン)
2. cancelを押すと、上のURLにリダイレクトする
3. さらにリダイレクトされ、App StoreでDMM恋活に飛ばされる
環境:
iPad2(iOS6.1.3), Safari
@osak
osak / a.S
Last active August 29, 2015 14:06
; gcc -v
; Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
; Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
; Target: x86_64-apple-darwin13.3.0
; Thread model: posix
;
; gcc -O -m32 a.c
00001f30 <_main>:
1f30: 55 push %ebp
1f31: 89 e5 mov %esp,%ebp
@osak
osak / a.rb
Last active August 29, 2015 14:16
require 'set'
require 'monitor'
log = []
END {
log << "end"
puts log
}
m = Monitor.new
h = Set.new
nnoremap <silent> <Plug>select_cstyle_if :<C-u>call <SID>select_cstyle_if()<CR>
function! s:select_cstyle_if() " {{{
let orig_view = winsaveview()
let if_start_pos = []
while searchpair('{', '', '}', 'bW', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"') != 0
let brace_start_pos = getpos('.')
normal! ge
let save = @"
normal! yl
function! s:eval_S_expression() " {{{
let ch = strpart(getline('.'), col('.')-1, 1)
let skip = 'index(["string", "schemeChar"], synIDattr(synID(line("."), col("."), 0), "name")) != -1'
if ch == ')'
let endline = line('.')
let startline = searchpairpos('(', '', ')', 'nbW', skip)[0]
elseif ch == '('
let startline = line('.')
let endline = searchpairpos('(', '', ')', 'nW', skip)[0]
else
# -*- coding: utf-8
miquire :addon, 'addon'
miquire :core, 'environment'
miquire :addon, 'settings'
require 'net/http'
module Net
class <<HTTP
alias new_org new
@osak
osak / mikutter-cairo-stringid-patch
Created May 8, 2011 13:33
このパッチあてたらmikutter-cairoがうごいた
Index: core/mui/cairo_timeline.rb
===================================================================
--- core/mui/cairo_timeline.rb (リビジョン 300)
+++ core/mui/cairo_timeline.rb (作業コピー)
@@ -23,7 +23,7 @@
# }
a
},
- :kind => :message_id, :widget => :text, :type => Integer, :label => ''},
+ :kind => :message_id, :widget => :text, :type => String, :label => ''},
Index: mentions.rb
===================================================================
--- mentions.rb (リビジョン 351)
+++ mentions.rb (作業コピー)
@@ -25,7 +25,7 @@
plugin.add_event(:favorite){ |service, fav_by, message|
if UserConfig[:favorited_by_anyone_act_as_reply] and fav_by[:idname] != service.idname
main.add(message)
- main.favorite(fav_by, message)
+ #main.favorite(fav_by, message)
/home/osa/app/mikutter/trunk/core/lib/lazy.rb:20:in `method_missing': undefined method `[]' for nil:NilClass (NoMethodError)
from /home/osa/app/mikutter/trunk/core/post.rb:114:in `block in user'
/home/osa/app/mikutter/trunk/core/lib/lazy.rb:20:in `method_missing': undefined method `[]' for nil:NilClass (NoMethodError)
from /home/osa/app/mikutter/trunk/core/post.rb:114:in `block in user'