Skip to content

Instantly share code, notes, and snippets.

" buffer書き換え前
let s:mychangedtick = b:changedtick
" buffer書き換えて操作
" ...
" 書き換え後に
" for tpope/vim-repeat
if exists('g:repeat_tick')
if g:repeat_tick == s:mychangedtick
@xdissent
xdissent / errors.coffee
Created May 27, 2014 16:03
Extendable native Error subclasses in Coffeescript
ok = (ok) -> console.log if ok then 'ok' else 'FAIL'
FnError = (message) ->
@name = 'FnError'
@message = message
@stack = (new Error).stack
FnError:: = new Error
@philfreo
philfreo / _README.md
Last active April 8, 2018 06:42
Make Dash button play iTunes to AirPlay speakers

Uses a (basically free) Amazon Dash Button to play/pause your iTunes music over AirPlay speakers.

Requires OS X and an AirPlay compatible speaker (e.g. Apple TV or any speaker hooked up to AirPort Express).

  1. Install node-dash-button and follow the instructions to get your Dash Button's MAC address.
  2. Install node-applescript
  3. Tweak code as desired, filling in your button's MAC address, name of your AirPlay speakers, etc.
  4. Run via Terminal: node dash_buttons.js
@Kuniwak
Kuniwak / 2013_11_15_githubjp_note.markdown
Last active October 30, 2018 07:06
「GitHub トレーニングチームから学ぶ Git の内部構造」のノートです。 曖昧なところもあるので、間違いがあったら教えてください! http://connpass.com/event/3808/

GitHub トレーニングチームから学ぶ Git の内部構造

Graphs, Hashes, and Compression, Oh My!

Hash について

従来の CVCS (集中バージョン管理システム)のリビジョン番号は連番。 SVN はサーバーにデプロイした時点でリビジョン番号1と設定される。

Best practices for building Vim plugins

2016-11-05 VimConf 2016

@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」という項目でトークンの発行が可能です。

@Gozala
Gozala / example.js
Created January 29, 2012 03:46
Workaround for lack of "tail call optimization" in JS
// Lack of tail call optimization in JS
var sum = function(x, y) {
return y > 0 ? sum(x + 1, y - 1) :
y < 0 ? sum(x - 1, y + 1) :
x
}
sum(20, 100000) // => RangeError: Maximum call stack size exceeded
// Using workaround
@kwmt
kwmt / Castle.xml
Last active November 9, 2021 01:16 — forked from bemasher/Castle.xml
<?xml version="1.0" encoding="UTF-8" ?>
<Data>
<Series>
<id>83462</id>
<Actors>|Nathan Fillion|Stana Katic|Molly C. Quinn|Jon Huertas|Seamus Dever|Tamala Jones|Susan Sullivan|Ruben Santiago-Hudson|Monet Mazur|</Actors>
<Airs_DayOfWeek>Monday</Airs_DayOfWeek>
<Airs_Time>10:00 PM</Airs_Time>
<ContentRating>TV-PG</ContentRating>
<FirstAired>2009-03-09</FirstAired>
<Genre>|Drama|</Genre>
@hyle
hyle / ko.utils.signatures.js
Last active May 14, 2022 21:15
KnockoutJS utils (ko.utils) signatures
// knockout 2.2.1
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }
ko.utils.arrayForEach = function (array, action) { /* .. */ }
ko.utils.arrayGetDistinctValues = function (array) { /* .. */ }