Skip to content

Instantly share code, notes, and snippets.

@takyam-git
takyam-git / index.php
Created Mar 7, 2015
PHPParserおためし
View index.php
<?php
define('MY_CONSTANT', 1234);
$constantName = 'MY_CONSTANT2';
define($constantName, 7890);
$globalVariable = 'aiueo';
$GLOBALS['secondGlobal'] = 'abcde';
function globalFunction($arg1, $arg2 = false)
{
global $globalVariable, $globalVariable2;
$localVariable = 2;
View dwango5.go
package main
import (
"os"
"net/http"
"io"
"path/filepath"
"sync"
"github.com/codegangsta/cli"
"runtime"
@takyam-git
takyam-git / Gmail-x-ml-name-filter-sample.js
Created Dec 13, 2012
Google Apps Script で、 受信箱(Inbox)の X-ML-NAME をキーに ラベルをつけてアーカイブするサンプル。
View Gmail-x-ml-name-filter-sample.js
function processInbox() {
var match_x_ml_name = function(message, name){
var raw = message.getRawContent();
var reg = new RegExp('X-ML-Name:(\\s+)?' + name, 'g');
return raw.match(reg) != null;
}
var filters = [
['x-ml-name_value', 'parent_label/child_label']
];
@takyam-git
takyam-git / GoogleReader.coffee
Created Apr 1, 2012
PhoneGapでGoogleReaderにアクセスするモデル的なやつ(書いただけで動作検証まだ)
View GoogleReader.coffee
#
# GoogleReaderへのアクセサ的な何か
# GoogleのOAuth2については下記サイトを参照
# http://www.eisbahn.jp/yoichiro/2011/10/oauth2-0_google-api.html
# * Phonegap ONLY
# * Need "ChildBrowser" plugin
# * Need enable cross domain post request
#
class GoogleReader
# コンストラクタ