Skip to content

Instantly share code, notes, and snippets.

View naokazuterada's full-sized avatar
🌏
hello world!

Naokazu Terada naokazuterada

🌏
hello world!
View GitHub Profile
@mayneyao
mayneyao / notion2blog.js
Last active June 15, 2024 02:51
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
@mtei
mtei / helix_keyboard_build_tool_memo.md
Last active August 24, 2023 08:19
キーボード自作、特に Helix キーボードキットの製作に最低必要な工具のメモ
@qoomon
qoomon / TravisGitHub.md
Last active August 6, 2023 04:59
Setup GitHub Deploy Keys For Travis
@ytsuboi
ytsuboi / 2fa-cli.md
Last active July 2, 2021 05:26
GitHubの2段階認証を有効にした状態で、repositoryの操作をコマンドラインで行うためのメモ

二段階認証を有効にする方法

2段階認証を有効にする方法は適当にググってください。 たしか、ログインした状態で、右上のアイコンの右にある▼をクリック、Settings→Securityに「Two-factor authentication」という設定項目があるはずです。 Google Authenticatorなどの、RFC 6238 Time-Based One-Time Password Algorithmを搭載したトークン発生器を用意しておいてください。

ただし、二段階認証を有効にすると、コマンドラインでgit cloneしたり、push、pullなどの操作を行おうとすると、認証で蹴られるようになります。

二段階認証を有効にした場合のgitコマンドでの操作

二段階認証を有効にしたら、GitHubのウェブで、Personal Access Tokenを取得して、これを使います。 GitHubのCreating an access token for command-line useに書いてありますが、二段階認証を有効にしたときと同じく、ログインした状態で右上のアイコンの右にある▼をクリックし、「Personal access tokens」という項目でトークンの発行が可能です。

@raybrownco
raybrownco / image_helpers.rb
Last active July 10, 2021 13:37
Inline SVG in Middleman
# Middleman - Inline SVG Helper
# ------------------------------------------------------------------------------
#
# Installation
# ------------
# 1. Save this file at `[project_root]/helpers/image_helpers.rb`
# 2. Open the project's Gemfile and add this line: `gem "oga"`
# 3. Run `bundle install` from the command line
#
# Note: Restart your local Middleman server (if it's running) before continuing
@naokazuterada
naokazuterada / reset_rebase.sh
Last active May 15, 2024 05:40
git rebaseを間違えた時に元に戻す
git reflog
# これで、以下の様なのが参照できる
2be6f11 HEAD@{0}: xxxxxxxxxxxx
18389ad HEAD@{1}: xxxxxxxxxxxxx
0c485c8 HEAD@{2}: xxxxxxxxxxxxxx
b751438 HEAD@{3}: xxxxxxxxxxxxxxx # ここに戻したいので一つ前の数字を指定↓
hc8a0s8 HEAD@{4}: xxxxxx
# 「q」で戻って・・・
git reset --hard 'HEAD@{4}'
# のように数字を指定すると元に戻る!
@futhr
futhr / capybara.rb
Last active April 21, 2016 19:14 — forked from afn/gist:c04ccfe71d648763b306
Restart and retry when Poltergeist fails randomly.
# Borrowed from https://github.com/y310/rspec-retry/blob/master/lib/rspec/retry.rb
# Drop this script into spec/support
# To test snippet just set timeout to 1
RSpec.configure do |config|
Capybara.javascript_driver = :poltergeist
Capybara.register_driver(:poltergeist) do |app|
Capybara::Poltergeist::Driver.new app,
@chibicode
chibicode / Sublime Textの検索窓に日本語を入力する方法.md
Created July 26, 2014 03:27
Sublime Textの検索窓に日本語を入力する方法

Sublime Textの検索窓に日本語を入力するとEnterを押すなり文字が消えてしまうのですが、無理やり解決する方法を見つけました。ググってもこちらのバグレポートしか見つからなかったので報告です。

わたしの環境はMac OS XのSublime Text 3 (Build 3059)ですが、この解決方法はSublime Text 2 (Build 2220)にも対応しています。Windowsの場合は不明です。

ステップ1: Sublime Text 3の場合のみ: Default (OSX).sublime-keymapを編集可能にする

このステップはSublime Text 3の場合のみ必要です。Sublime Text 2の場合はステップ2に行って下さい。

@voluntas
voluntas / eval.rst
Last active April 8, 2024 03:13
評価制度の無い評価制度
@TravelingTechGuy
TravelingTechGuy / ChromeExtensionGulp.js
Created April 5, 2014 19:22
Gulp file for building a Chrome Extension
'use strict';
//npm install gulp gulp-minify-css gulp-uglify gulp-clean gulp-cleanhtml gulp-jshint gulp-strip-debug gulp-zip --save-dev
var gulp = require('gulp'),
clean = require('gulp-clean'),
cleanhtml = require('gulp-cleanhtml'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
stripdebug = require('gulp-strip-debug'),