- Open Automator
- Create a new Service
- Add a
Run Shell Script
action - Set input to Service receives selected
files or folders
inany application
- Set the script action to
/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n "$@"
- Set Pass input to
as arguments
- Save as
Open in Sublime Text
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
sealed trait Obj | |
case class Error(error:String) extends Obj | |
case class DataA(a1:String, a2: Int) extends Obj | |
case class DataB(b1:String, b2: Boolean) extends Obj | |
val strA = """{"a1":"foo", "a2": 1}""" | |
val strB = """{"b1":"bar", "b2": false}""" | |
val srtE = """{"error": "oops"}""" | |
object JsonProtocols extends DefaultJsonProtocol { |
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
intexit() { | |
# Kill all subprocesses (all processes in the current process group) | |
kill -HUP -$$ | |
} | |
hupexit() { | |
# HUP'd (probably by intexit) | |
echo | |
echo "Interrupted" | |
exit |
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
export CUDA_HOME=/usr/local/cuda | |
export DYLD_LIBRARY_PATH=${CUDA_HOME}/lib:${CUDA_HOME}/extras/CUPTI/lib:/Developer/NVIDIA/CUDA-8.0/lib | |
export LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH | |
export PATH=$DYLD_LIBRARY_PATH:$PATH |
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
lsof -n -i4TCP:$PORT | grep LISTEN |
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
Math.random().toString(36).substring(7); |
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
// part A | |
var client = require('seneca')() | |
.use('seneca-amqp-transport') | |
.client({ | |
type: 'amqp', | |
url: 'amqp://guest:guest@localhost:5672/seneca', | |
pin: 'role:test2' | |
}) | |
.client({ |
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 client = io.connect(socketURL, options); | |
client.on('connect', function(data) { | |
console.log("client receive connect" + data); | |
}); | |
client.on('connect_confirm', function(data) { | |
console.log('confirm'); | |
}); |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "puppetlabs/centos-7.0-64-puppet" | |
config.vm.host_name = "socket" | |
config.vm.network "forwarded_port", guest: 8004, host: 8004 | |
config.ssh.forward_agent = true |
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
# AKKA Actor snippets | |
## [scala][akka] avoid sender mixing (using pattern match guard) | |
``` | |
def receive = { | |
case x if sender == child1 => do sth | |
case x if sender == child2 => do sth else | |
case x => child forward x | |
} |