This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(){ | |
//without space line or semicolon | |
} | |
// some comment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IrcBot = require 'hubot-irc' | |
module.exports = (robot) -> | |
dummy = IrcBot.use(robot) | |
if(robot.adapter.constructor is not dummy.constructor) | |
return | |
robot.enter () -> | |
bot = robot.adapter.bot | |
bot.say = (target, str) -> | |
this.notice(target, str) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require("path") | |
var cheerio = require('cheerio') | |
var request = require("request") | |
var fs = require("fs") | |
var mkdirp = require("mkdirp") | |
require('events').EventEmitter; // TODO:イベントハンドリングするにはこれだったけど。 | |
module.exports = function(url, options){ | |
var getBaseUrl = function(url){ | |
var urlObj = require('url').parse(url); | |
return urlObj.protocol+"//"+urlObj.host; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
[ | |
{ "keys": ["tab"], "command": "NULL" } , | |
{ "keys": ["tab"], "command": "insert", "args": {"characters": "\t"} }, | |
{ "keys": ["tab"], "command": "replace_completion_with_next_completion", "context": | |
[ | |
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" }, | |
{ "key": "setting.tab_completion", "operator": "equal", "operand": true } | |
] | |
}, | |
{ "keys": ["tab"], "command": "reindent", "context": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var glob = require("glob"); | |
var fs = require("fs"); | |
var path = require("path") | |
glob("./LONG_FILE_NAME/**/",function(err, files){ | |
files.reverse().forEach(function(f){ | |
var newFsp = f.split("/") | |
newFsp.pop() | |
newFsp.pop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set package.json and `npm init` | |
// or | |
// $npm install init; | |
// $npm install hubot --save | |
// $npm install coffee-script --save | |
var fork = require('child_process').fork | |
var fs = require("fs") | |
var env = { | |
//"HUBOT_IRC_SERVER" : "", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pigudf; | |
import java.io.IOException; | |
import org.apache.pig.EvalFunc; | |
import org.apache.pig.data.Tuple; | |
/** | |
* Usage: | |
* log = LOAD logfile.txt AS (time:int, path:chararray, ua:chararray) | |
* log = FOREACH log GENERATE time, path, ua, pigudf(ua) AS browser; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare function exampleFunc() : int; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* cssinclude.js | |
* | |
* extend syntax like @import "some.css" | |
* to actualy css file contents when imported css exist. | |
* If imported css file isn't exist, not execute replace. | |
* | |
* * usage * | |
* var cssString | |
* cssString = require('./cssinclude').extend(cssString); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wildCardToRegexp(wildCardPattern){ | |
var regexpOperator = '^$\\.+?()[]{}|'; | |
for(var i = 0; i < regexpOperator.length; i++){ | |
var operator = regexpOperator[i]; | |
wildCardPattern = wildCardPattern.replace(operator,"\\"+operator); | |
} | |
return wildCardPattern.replace("*",".*"); | |
} |