Skip to content

Instantly share code, notes, and snippets.

View kyanny's full-sized avatar

Kensuke Nagae kyanny

View GitHub Profile
/**
* Observe MailBox
*
* @param {string} condition メール検索条件(require)
* @param {function} onSuccess 条件合致時のコールバック(optional)
* @param {function} onFailure 例外発生時のコールバック(optional)
**/
function observe(condition, onSuccess, onFailure) {
try {
var observer = new GmailObserver(condition),
@mala
mala / cors_killer.js
Last active November 4, 2016 17:58
responseURLに対応していないライブラリを使っているときにクロスドメイン通信を無理やり止める
// responseURLに対応していないライブラリを使っているときにクロスドメイン通信を無理やり止める
// https://github.com/jquery/jquery/pull/1615
// responseURL
// https://bugzilla.mozilla.org/show_bug.cgi?id=998076
// https://bugs.chromium.org/p/chromium/issues/detail?id=377583
// https://bugs.webkit.org/show_bug.cgi?id=136938
new function(){
@mala
mala / gist:f33c9654af5e06e8bca9
Last active November 15, 2016 13:25
クライアントサイドでガチャ

目的

  • サーバー側でガチャのアイテムを選択すると確率操作している疑いがかかるので、事前に提示した確率から変更が出来ず疑いが掛からないような方式を提案する
  • サーバー側でもクライアント側でも不正が出来ないことが要件として求められる
  • 簡便なアルゴリズムで一般市民にも理解しやすく、また、解析によるアルゴリズムの把握が容易であることが望ましい

かんがえかた

これ相当のことを、サーバーとクライアントでやればいい。

@priithaamer
priithaamer / config.ru
Created October 21, 2010 09:30
Gollum rackup script
#!/usr/bin/ruby
require 'rubygems'
require 'gollum/frontend/app'
system("which git") or raise "Looks like I can't find the git CLI in your path.\nYour path is: #{ENV['PATH']}"
gollum_path = '/Users/priit/Documents/Fraktal/Wiki'
disable :run
@etdev
etdev / kyobashi_restaurants.md
Created June 20, 2017 03:51
Kyobashi Restaurants
Name Price Range (higher = more expensive) Tabelog Rating Distance to Kyobashi Staiton URL Type of Food
ダバインディア 2 3.94 0.2 km https://tabelog.com/tokyo/A1302/A130202/13000506/ インドカレー; インド料理
3丁目のカレー屋さん 1 3.63 0.3 km https://tabelog.com/tokyo/A1302/A130202/13025962/ カレーライス
京橋屋カレー 1 3.62 0.5 km https://tabelog.com/tokyo/A1302/A130202/13027104/ カレーライス
紅花別館 1 3.6 0.8 km https://tabelog.com/tokyo/A1302/A130202/13000487/ 洋食; カレーライス; 鉄板焼き
根室花まる KITTE丸の内店 2 3.59 0.9 km https://tabelog.com/tokyo/A1302/A130201/13153777/ 回転寿司
近為 大丸東京店 1 3.59 0.8 km https://tabelog.com/tokyo/A1302/A130201/13044475/ 和食(その他); 京料理
ミート矢澤アンドブラッカウズ 大丸東京 テイクアウトステーション 1 3.59 0.8 km https://tabelog.com/tokyo/A1302/A130201/13145852/ 弁当
お好み焼 きじ 丸の内店 1 3.59 0.6 km https://tabelog.com/tokyo/A1302/A130201/13020110/ 焼きそば; お好み焼き
@drmohundro
drmohundro / private.xml
Last active September 21, 2017 00:36
Karabiner private.xml to swap option and command keys for Parallels
<?xml version="1.0"?>
<root>
<appdef>
<appname>PARALLELS</appname>
<equal>com.parallels.desktop.console</equal>
</appdef>
<devicevendordef>
<vendorname>MICROSOFT</vendorname>
<vendorid>0x045e</vendorid>
@liammclennan
liammclennan / blog_backbone_style.md
Created June 7, 2012 06:33
Backbone.js Style / Patterns

Naming Rules

Use PascalCase for constructors, namespaces and modules:

var m = new Backbone.Model(); 

Prefix private properties with _

This is a convention to compensate for JavaScript's lack of private properties on objects. Being able to identify private methods is important because it tells us that we don't need to test those methods and that they will not be coupled to anything outside of the object.

@eadz
eadz / gist:10220496
Created April 9, 2014 02:27
slack custom css
/*
User Stylesheet for Slack.
Use with http://www.squarefree.com/userstyles/make-bookmarklet.html
to make a custom css Bookmarket
*/
.light_theme .message {
(function() {
function Dispatcher() {
this.routes = [];
}
Dispatcher.prototype.route = function route(path, action) {
this.routes.push({ path: path, action: action });
return this;
};
@onk
onk / .rubocop.yml
Last active January 15, 2018 02:30
僕の使っている .rubocop.yml
# rubocop v0.35.0 から inherit_gem という機能が増えたので gem にしました
# https://github.com/onk/onkcop
inherit_gem:
onkcop: "config/rubocop.yml"