This file contains 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/ruby | |
puts "hoge" |
This file contains 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/sh | |
echo "file.txt" | sed -e 's/\(.\+\)\(\..\+\)/\1\2/g' |
This file contains 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/sh | |
ls -lh */* | grep vmdk | awk '{print $5}' | sed -e 's/\(.\+\)G/\1/' | awk '{s += $1; print s}' |
This file contains 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/ruby | |
print 'Input> ' | |
val = gets.chomp |
This file contains 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
% sudo port selfupdate && sudo port install opencv | |
---> Configuring ffmpeg | |
Error: Target org.macports.configure returned: configure failure: shell command failed (see log for details) | |
Log for ffmpeg is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/main.log | |
Error: Unable to upgrade port: 1 | |
Error: Unable to execute port: upgrade ffmpeg failed | |
To report a bug, see <http://guide.macports.org/#project.tickets> |
This file contains 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/sh | |
# | |
# This shell script passes all its arguments to the binary inside the | |
# MacVim.app application bundle. If you make links to this script as view, | |
# gvim, etc., then it will peek at the name used to call it and set options | |
# appropriately. | |
# | |
# Based on a script by Wout Mertens and suggestions from Laurent Bihanic. This | |
# version is the fault of Benji Fisher, 16 May 2005 (with modifications by Nico | |
# Weber and Bjorn Winckler, Aug 13 2007). |
This file contains 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 down = false; | |
canvas.addEventListener('mousedown', function (e) { | |
down = true; | |
ctx.beginPath(); | |
ctx.moveTo(e.clientX, e.clientY); | |
}, false); | |
window.addEventListener('mousemove', function (e) { | |
if (!down) return; | |
console.log(e.clientX, e.clientY); | |
ctx.lineTo(e.clientX, e.clientY); |
This file contains 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 socket = new io.Socket(); | |
socket.connect(); | |
socket.on('connect', function(data) { | |
console.log("connect session: " + socket.transport.sessionid); | |
}); |
This file contains 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 down = false; | |
canvas.addEventListener('mousedown', function (e) { | |
down = true; | |
ctx.beginPath(); | |
ctx.moveTo(e.clientX, e.clientY); | |
socket.send({ | |
act: "down", | |
x: e.clientX, | |
y: e.clientY, | |
color: ctx.strokeStyle |
This file contains 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
io = require('socket.io'); | |
var socket = io.listen(app); | |
socket.on('connection', function(client) { | |
client.on('message', function(data) { | |
client.broadcast(data); | |
}); | |
}); |
OlderNewer