Alias for git is configured into the file .git/config
:
[alias]
publish = !sh ./scripts/publish.sh
The script file ./scripts/publish.sh
looks like this:
#!/bin/sh
set -e
"use strict"; | |
var y = [] + {}; | |
console.log( typeof y ); | |
var x = {} + []; | |
console.log( typeof x ); | |
// $ node foo.js | |
// string |
function is_object(a) { | |
return a && (typeof a === 'object'); | |
} | |
function step(last, current) { | |
if(is_object(last)) { | |
return last[current]; | |
} | |
} |
var Socket = require('src/backend/io/Socket.js'); | |
/** RemoteSocket */ | |
function RemoteSocket(socket) { | |
debug.assert(socket).is('object'); | |
debug.assert(socket.$id).is('uuid'); | |
debug.assert(socket.worker).is('string'); | |
debug.assert(socket.id).is('string'); |
*.txt |
Alias for git is configured into the file .git/config
:
[alias]
publish = !sh ./scripts/publish.sh
The script file ./scripts/publish.sh
looks like this:
#!/bin/sh
set -e
<html> | |
<head> | |
<title>Hello World</title> | |
</head> | |
<body> | |
<h1>Hello World</h1> | |
<p>This is content for development test tool.</p> | |
</body> | |
</html> |
This script only prints the commands needed to uninitialize a iSCSI target in OpenSolaris based OS.
Run it like ./unsharedataset.sh storage/iscsi/nor-atlas
:
+ test -n storage/iscsi/nor-atlas
+ test -n 600144F06FD5CE0000004DC06C000003
+ test -n iqn.1986-03.com.sun:02:55514a4d-a70c-c4ae-a26d-f9a7a665e8ef
+ test xiqn.1986-03.com.sun:02:55514a4d-a70c-c4ae-a26d-f9a7a665e8ef != x-
----
My nanorc settings.
Save js.nanorc
to /opt/nano/js.nanorc
etc.
Then use it with:
include "/opt/nano/js.nanorc"
Sample ~/.nanorc
is in file nanorc
.
var express = require('express'); | |
var app = module.exports = express.createServer(); | |
var io = require('socket.io').listen(app); | |
io.configure('development', function(){ | |
io.set('log level', 1); | |
io.set('transports', ['xhr-polling', 'websocket']); | |
}); | |
io.configure('production', function(){ |
/* Run SQL query group */ | |
var move_player = sql.group( | |
sql.query(['next_number'], 'SELECT MAX(number)+1 AS number FROM reg WHERE game_id=:game_id'), | |
sql.query(['old_user_id'], 'SELECT user_id FROM reg WHERE number=:old_number AND game_id=:game_id'), | |
sql.query(['new_user_id', 'new_reg_id'], 'SELECT user_id, reg_id FROM reg WHERE number=:new_number AND game_id=:game_id'), | |
sql.query('DELETE FROM player WHERE reg_id=:new_reg_id AND game_id=:game_id LIMIT 1'), | |
sql.query('DELETE FROM reg WHERE reg_id=:new_reg_id AND game_id=:game_id LIMIT 1'), | |
sql.query('DELETE FROM auth WHERE user_id=:old_user_id AND game_id=:game_id LIMIT 1'), | |
sql.query('UPDATE reg SET user_id=:new_user_id WHERE user_id=:old_user_id AND game_id=:game_id'), | |
sql.query('UPDATE auth SET user_id=:new_user_id WHERE user_id=:old_user_id AND game_id=:game_id') |