Skip to content

Instantly share code, notes, and snippets.

View dulao5's full-sized avatar

Du Zhigang (ト シゴウ) dulao5

View GitHub Profile
@dulao5
dulao5 / file0.txt
Last active June 6, 2016 06:02
Sails.js(Node.js)でSessionを無駄にしないように使い方 ref: http://qiita.com/dulao5/items/c0b6e2a7ea16e1d9116c
curl -v http://127.0.0.1:1337/login > /dev/null
> GET /login HTTP/1.1
...
< HTTP/1.1 200 OK
< X-Powered-By: Sails <sailsjs.org>
...
< Set-Cookie: sails.sid=s%3AvX4jELukbYhzct43etS21uRU.apwQfFIzp1bpAgvTYaIfx%2FaheTw%2B0DoLKQV52a98uEg; Path=/; HttpOnly
...
@dulao5
dulao5 / file0.rb
Last active August 29, 2015 14:12
mecab-rubyのMeCab::Tagger#parseToNodeをEnumberatorする ref: http://qiita.com/dulao5/items/6e080a66655f2e28c8be
# -*- coding: utf-8 -*-
require "mecab"
node = MeCab::Tagger.new.parseToNode("すもももももももものうち")
while node
puts "#{node.surface}\t#{node.feature}"
node = node.next
end
@dulao5
dulao5 / file0.rb
Last active August 29, 2015 14:14
Ruby初心者の不思議な経験 ref: http://qiita.com/dulao5/items/5bf55262aac6446e719e
print("abc") # print "abc" and return nil
print "abc" # print "abc" and return nil
print() # print "" and return nil
print # print "" and return nil
# 括弧がなくてもprint()と同じで、print関数の値を取れません
method(:print) # => #<Method: Object(Kernel)#print>
@dulao5
dulao5 / gist:c8f8e82a2b81b8f598eb
Created April 2, 2015 06:07
build.ios/Podfile
platform :ios, '8.0'
inhibit_all_warnings!
pod 'msgpack', :path => '../../libSN/middleware/msgpack-c'
pod 'OpenSSL', :path => '../../libSN/middleware/openssl-ios'
pod 'cocos2dx', :path => '../../libSN/middleware/cocos2dx/cocos2dx'
pod 'curl', :path => '../../libSN/middleware/curl-69.2'
pod 'Tremor', :path => '../../libSN/middleware/Tremor'
@dulao5
dulao5 / gist:ea7b30dc0a2bce90f039
Created April 2, 2015 06:20
build.osx link error
Undefined symbols for architecture x86_64:
"TaskInGamePurchase::create()", referenced from:
SysGameManager::updateGame() in SysGameManager.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
@dulao5
dulao5 / Readme.md
Last active November 2, 2017 14:02
make-contents.md

Markdownドキュメントの目次を自動的に作るツールです。

  • main.jsのJavaScriptをコピーして、ここにペストしてください。
  • Bookmarklet nameMD Contentsを入力してください。
  • Compressボッタンを押してください。
  • 画面下の辺のMD Contentsの__リンク__を __ドロップ__して、ブラウザのBookmark Tools Barに移動してください。
  • 使いたい際に、ブラウザでMarkdownのページを開いて、Bookmark Tools BarMD Contentsをクリックしてください。
    • ポップアップの内容は目次です。すべてを選んで、Wikiにコピペしてください。
@dulao5
dulao5 / NilClass.debug.rb
Created December 21, 2016 08:24
NilClass debug
# debug error : undefined method stage for nil:NilClass
class NilClass
def stage
puts caller.join("\t")
nil
end
end
@dulao5
dulao5 / find-mutex-in-instance_variables.rb
Created November 10, 2017 05:55
find Mutex in instance_variables
def find_mutex(v, rootname, level=1)
prefix = "\t" * level
found_name = nil
puts prefix + "now find " + rootname
v.instance_variable_names.each {|name|
puts prefix + "find " + rootname + " > " + name
namev = v.instance_variable_get(name);
puts prefix + "find " + rootname + " > " + name + " class : " + namev.class.to_s
found_name = if(namev.class == Mutex)
@dulao5
dulao5 / ruby_dry_run_plugin.rb
Created November 15, 2017 03:30
dry_run plugin
class ClassA
class << self
def sendtouser(id, id2)
puts "origin sendtouser #{id} #{id2}"
end
end
end
module DryRunModule
@dulao5
dulao5 / conf_page_links_to_markdown.js
Created February 9, 2018 05:48
conf_page_links_to_markdown.js