This file contains hidden or 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
require "nkf" | |
require 'google/apis/gmail_v1' | |
require 'googleauth' | |
require 'googleauth/stores/file_token_store' | |
require 'rmail' | |
require 'fileutils' | |
class GmailMailer |
This file contains hidden or 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
/* | |
1~100までの整数においてFizzBuzzプログラムを実装してください。 | |
好きな言語で、可能な限り可読性が高く、可能な限り簡潔なコードで記述してください。 | |
*/ | |
//Java 8 | |
import java.util.stream.*; | |
public class FB { | |
public static void main(String[] args) { | |
IntStream.rangeClosed(1, 100) |
This file contains hidden or 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
mecab -d /usr/local/lib/mecab/dic/mecab-ipadic-neologd text.txt \ | |
| grep -v '助詞,' \ | |
| grep -v '助動詞,' \ | |
| grep -v EOS \ | |
| sort \ | |
| uniq -c \ | |
| sort -k1 -n |
This file contains hidden or 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
<style type="text/css"> | |
div { | |
width: 100px; | |
height: 100px; | |
background-color: red; | |
border-radius: 1000000000px; | |
} | |
</style> | |
<div/> |
This file contains hidden or 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 BOT_NAME = 'translator_bot' | |
var SLACK_OUTGOING_TOKEN = PropertiesService.getScriptProperties().getProperty("slack_outgoing_token"); | |
var SLACK_API_TOKEN = PropertiesService.getScriptProperties().getProperty("slack_api_token"); | |
var SlackApp = SlackApp.create(SLACK_API_TOKEN) | |
var MS_API_TOKEN = PropertiesService.getScriptProperties().getProperty("ms_api_token"); | |
var PRIMARY_LANGUAGE = "ko" | |
var SECONDARY_LANGUAGE = "ja" |
This file contains hidden or 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
#!/bin/bash | |
DIFFCOMMAND=diff | |
if [ $# -lt 1 ] ; then | |
echo "usage: $0 [rev1] [rev2] filename" | |
exit 1 | |
elif [ $# -eq 1 ] ; then | |
$DIFFCOMMAND <(git show HEAD:"${@:1}" | git lfs smudge) "${@:1}" | |
elif [ $# -eq 2 ] ; then | |
$DIFFCOMMAND <(git show $1:"${@:2}" | git lfs smudge) "${@:2}" |
This file contains hidden or 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
#!/bin/bash | |
DIFFCOMMAND=diff | |
MTEXTPIPECOMMAND="grep 'mText:' | perl -Xpne 's/\\\\u([0-9a-fA-F]{4})/chr(hex("'$1'"))/eg'" | |
if [ $# -lt 1 ] ; then | |
echo "usage: $0 [--mtext] [rev1] [rev2] filename" | |
exit 1 | |
fi |
This file contains hidden or 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
#!/bin/bash | |
# Usage: slackpost "<webhook_url>" "<channel>" "<username>" "<message>" ["<attached_message>"] | |
export LANG=ja_JP.utf8 | |
# ------------ | |
webhook_url=$1 | |
if [[ $webhook_url == "" ]] | |
then |
This file contains hidden or 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(JSON) { | |
regex=/characterId/; | |
var oldParse = JSON.parse; | |
JSON.parse = function newParse(str) { | |
if (str.match(regex)) { | |
str = str.replace(/"isNew":true/g, '"isNew":false'); | |
console.log(str); | |
str = str.replace(/"rarity":4/g, '"rarity":2'); | |
return oldParse(str); |
This file contains hidden or 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
//console contextを `index.php` (IP直書きのやつ)にセットしておくこと | |
//https://stackoverflow.com/questions/3275816/debugging-iframes-with-chrome-developer-tools | |
//Safariの場合 `htmlwrap` というのをさがせばよい | |
startTime = performance.now(); | |
createjs.Ticker._getTime = () =>{ | |
return startTime + (performance.now() - startTime) * 5; | |
} | |
createjs.Ticker.framerate = 60 / 5; //for saving CPU usage |