Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I 💟 🍛

teitei-tk teitei-tk

💭
I 💟 🍛
View GitHub Profile
@teitei-tk
teitei-tk / Dockerfile
Created Jul 28, 2020
Next.js with Docker multi stage build
View Dockerfile
FROM node:12.18.2-alpine as builder
WORKDIR /app
COPY package.json .
COPY yarn.lock .
COPY tsconfig.json .
RUN yarn install --production
View .gitconfig
[alias]
detect-branches = !git checkout $(git branch | peco)
@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";
You can’t perform that action at this time.