Skip to content

Instantly share code, notes, and snippets.

@yewton
yewton / emacs.idekeybindings
Created August 22, 2012 16:09 — forked from taksatou/emacs.idekeybindings
more emacs like keybindings for xcode 4.3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Menu Key Bindings</key>
<dict>
<key>Key Bindings</key>
<array>
<dict>
<key>Action</key>
@yewton
yewton / git-svn-externals.rb
Created November 14, 2012 03:45 — forked from koshigoe/git-svn-externals.rb
clone svn:externals
#!/usr/bin/env ruby
#
# Inspired by https://github.com/andrep/git-svn-clone-externals
#
# MIT License http://koshigoe.mit-license.org
#
require 'fileutils'
module Git

Haskell チートシート

インストール

$ brew install ghc
$ brew install --env=std haskell-platform

REPL起動

@yewton
yewton / find_and_sort_by_mtime.sh
Last active December 11, 2015 17:28
find した結果を mtime 順にソートする
find -type f | xargs ls -l --time-style long-iso | sort -k6d -k7d
// from http://stackoverflow.com/questions/15182496/why-does-this-code-print-hello-world
import java.util.Random
import scala.annotation.tailrec
object HelloWorld extends App {
println(randomString(-229985452) +" "+ randomString(-147909649))
println(randomString2(-229985452) +" "+ randomString2(-147909649))
println(randomString3(-229985452) +" "+ randomString3(-147909649))
println(randomString4(-229985452) +" "+ randomString4(-147909649))
def randomString(i :Int) :String = {
@yewton
yewton / znc-1.0.20130318.diff
Last active December 15, 2015 01:59
ZNC-1.0 の Buffer Playback を Notice にする
diff -Naru znc-1.0.orig/src/Chan.cpp znc-1.0/src/Chan.cpp
--- znc-1.0.orig/src/Chan.cpp 2013-03-18 04:46:49.000000000 +0900
+++ znc-1.0/src/Chan.cpp 2013-03-18 05:20:17.000000000 +0900
@@ -548,7 +548,7 @@
NETWORKMODULECALL(OnChanBufferStarting(*this, *pUseClient), m_pNetwork->GetUser(), m_pNetwork, NULL, &bSkipStatusMsg);
if (!bSkipStatusMsg) {
- m_pNetwork->PutUser(":***!znc@znc.in PRIVMSG " + GetName() + " :Buffer Playback...", pUseClient);
+ m_pNetwork->PutUser(":***!znc@znc.in NOTICE " + GetName() + " :Buffer Playback...", pUseClient);
}
@yewton
yewton / hosts
Created December 2, 2014 06:36
rubygems 繋がんない用 hosts
199.91.171.93 au-m.rubygems.org bb-m.rubygems.org
54.186.104.15 api.rubygems.org rubygems.org
@yewton
yewton / swagger.json
Last active December 21, 2015 12:29
test
{
"swagger": "2.0",
"info": {
"description": "",
"version": "1.0.0",
"title": "Swagger Petstore"
},
"host": "petstore.swagger.io",
"basePath": "/v2",
"schemes": [
@yewton
yewton / crop_last_n_seconds.sh
Last active January 5, 2019 12:44
Crop last N seconds w/ FFmpeg one-liner
gfind . -name '*.mp4' -print0 | gxargs -0 -I{} sh -c 'ffmpeg -i "{}" -t $(echo "$(ffprobe -i "{}" -show_entries format=duration -v quiet -of csv="p=0") - 15" | bc) "cropped_$(basename "{}")"'
@yewton
yewton / openapi.yml
Last active December 6, 2017 06:15
Swagger Petstore with OAuth 2.0 (Relative path)
openapi: 3.0.0
info:
version: 1.0.0
title: Swagger Petstore
license:
name: MIT
servers:
- url: 'http://www.example.org'
paths:
/pets: