~% say --audio-device ?
209 AirPlay
38 Built-in Output
198 Soundflower (2ch)
63 Soundflower (64ch)
55 VoilaDevice
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
image_file = "/tmp/gyazo_printer#{$$}.png" | |
pdf_file = "/tmp/gyazo_printer#{$$}.pdf" | |
`screencapture -i #{image_file}` | |
`sips -s format pdf #{image_file} --out #{pdf_file}` | |
`lpr #{pdf_file}` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mdns = require('multicast-dns')() | |
var ip = require('ip') | |
mdns.on('query', function (query) { | |
if (query.questions[0] && query.questions[0].name === 'dj.local') { | |
mdns.respond([ | |
{ name: 'dj.local', type: 'A', data: ip.address() }, | |
{ name: 'dj.local', type: 'AAAA', data: ip.address('ipv6') } | |
]) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'.source.js': | |
'Prototype': | |
'prefix': 'proto' | |
'body': '${1:class_name}.prototype.${2:method_name} = function (${3:first_argument}) {\n\t${0:// body...}\n}' | |
'Function': | |
'prefix': 'fun' | |
'body': 'function ${1:function_name} (${2:argument}) {\n\t${0:// body...}\n}' | |
'Generator': | |
'prefix': 'gen', | |
'body': 'function* ${1:function_name} (${2:argument}) {\n\t${0:// body...}\n}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function assign (object) { | |
history.replaceState( | |
Object.assign(history.state, object), | |
document.title | |
) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mocha --compilers coffee:coffee-react/register test.coffee |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
id=$(chrome-cli list links | grep "chrome://extensions/" | awk '{print $1}' | sed -E "s/^\[([0-9]+)\]$/\1/g") | |
if [[ -n $id ]] ; then | |
chrome-cli reload -t "$id" | |
else | |
chrome-cli open "chrome://extensions" | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /dev/tty | tee /dev/ttys000 | |
cat /dev/tty > /dev/ttys000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
list = Dir.glob('wiki/*.txt').map do |path| | |
title = `echo #{path} | xxd -r -p | nkf -E -w` | |
body = `cat #{path} | nkf -E -w` | |
{ | |
title: title, | |
body: body | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open "https://www.google.co.jp/maps/place/$(whereami --format sexagesimal | perl -MURI::Escape -ne 'print uri_escape($_)')" |