Skip to content

Instantly share code, notes, and snippets.

💭
🍛

teitei-tk teitei-tk

💭
🍛
Block or report user

Report or block teitei-tk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@teitei-tk
teitei-tk / file0.txt
Created Nov 12, 2018
Homebrewをアンインストールし、端末をクリーンな状態に戻し、インストールしたパッケージ群をRestoreする。 ref: https://qiita.com/teitei_tk/items/6cbe0e90a809b1a5ca19
View file0.txt
$ brew bundle dump
@teitei-tk
teitei-tk / file0.txt
Created Aug 10, 2018
Railsのversion更新時に伴うactiverecord-session-storeの振る舞いについて ref: https://qiita.com/teitei_tk/items/098ea3b167c8e44ec9da
View file0.txt
$ bin/rake db:sessions:clear
@teitei-tk
teitei-tk / Gemfile
Created Jul 6, 2018
Rails4からRails5へのテストケースでキーワード引数を機械的に一括変換する。 ref: https://qiita.com/teitei_tk/items/a95f6ec928b2b51559ad
View Gemfile
+ gem 'rails5-spec-converter'
View printPdf.js
import { writeFile } from 'fs';
import Chaldeas from 'chaldeas';
async function main() {
// EntryPointのClassを生成。
const chaldeas = Chaldeas.new();
try {
// chromeの立ち上げと、Debugging Protocolへの接続
const protocol = await chaldeas.fetchProtocol();
View aes_cipher.py
import base64
from Crypto import Random
from Crypto.Cipher import AES
class AESCipher(object):
def __init__(self, key, block_size=32):
self.bs = block_size
if len(key) >= len(str(block_size)):
self.key = key[:block_size]
else:
View init.coffee
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
View requirements.txt
Flask==0.6.1
IPy==0.81
Jinja2==2.7
MarkupSafe==0.18
PIL==1.1.7
Powerline==beta
Pygments==1.6
Twisted==12.0.0
Werkzeug==0.8.3
altgraph==0.9
View fizzbuzz.js
(function(){
console.log( "start fizzbuzz...\n" );
var fizzbuzz, result = [];
for ( var i = 1; i <= 100; i++ ) {
if ( i % 3 === 0 && i % 5 === 0 ) {
fizzbuzz = "fizzbuzz";
} else if ( i % 3 === 0 ) {
fizzbuzz = "fizz";
@teitei-tk
teitei-tk / yahooTextParseApiSample.php
Created Oct 22, 2012
Yahoo形態素解析APIのサンプル的なもの
View yahooTextParseApiSample.php
<?php
$appid = "APP_ID";
$sentence = mb_convert_encoding("シュレーディンガーの猫(しゅれーでぃんがーのぬこ)とは、平行宇宙に無限に自分の虚像を投射することで存在していると考えられている、猫のような生物(UMA)ないし「存在」、もしくは「現象」あるいは「箱」である。「わけのわからないもの」とも。", 'utf-8', 'auto');
$filter = "1|2|3|4|5|9|10";
$data = http_build_query(array(
"appid" => $appid,
"sentence" => $sentence,
"filter" => $filter,
"result" => "ma"
View gist:3425748
(function(){
var images = [
"http://24.media.tumblr.com/tumblr_li92qz4NtI1qhhb8uo1_400.jpg",
"http://24.media.tumblr.com/tumblr_m80ziwHwTZ1qz6rb1o1_500.jpg",
"http://25.media.tumblr.com/tumblr_m7m1lm8nqe1qbyxr0o1_500.png"
];
for (var i = 0, cnt = images.length; i < cnt; i++) {
new Image().src = images[i];
}
You can’t perform that action at this time.