Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/sh | |
| # See http://www.mikerubel.org/computers/rsync_snapshots/ | |
| # SRC is the source, e.g. sally:/mnt/mirror/ | |
| SRC="$1:$2" | |
| # BAK is the path to the backup dir, e.g. /var/backups/sally/backup | |
| BAK="/var/backups/$1/backup" | |
| # don't do anything if no ssh connection |
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
| mount -v /backup | |
| rsync -vaxE --delete --ignore-errors / /backup/ | |
| umount -v /backup |
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 fs = require('fs') | |
| // kernel | |
| var kernel = require('kernel') | |
| kernel('t2.html', function(err, tmpl) { | |
| if (err) throw err | |
| tmpl({ | |
| title: function(cb) { | |
| fs.readFile('bob', cb) |
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
| // from K&R section 4.3 | |
| #include <stdio.h> | |
| #include <stdlib.h> // for atof() | |
| #include <ctype.h> | |
| #define MAXOP 100 // max size of operand | |
| #define NUMBER '0' // signal that a number was found | |
| #define MAXVAL 100 // max depth of value stack | |
| #define BUFSIZE 100 |
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
| > JSON.stringify({aList: '\tthing1\n\tthing2\n'}) | |
| "{"aList":"\tthing1\n\tthing2\n"}" | |
| > JSON.parse('{"aList":"\tthing1\n\tthing2\n"}') | |
| ▼ SyntaxError: Unexpected token | |
| ▶ arguments: Array[1] | |
| ▶ get message: function getter() { [native code] } | |
| ▶ get stack: function getter() { [native code] } | |
| ▶ set message: function setter() { [native code] } | |
| ▶ set stack: function setter() { [native code] } | |
| type: "unexpected_token" |
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
| set expandtab | |
| set hidden | |
| set incsearch | |
| set noshowmatch | |
| set showcmd | |
| set smartcase | |
| set smarttab | |
| set sw=4 | |
| set ts=4 |
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
| # the function below is called because it is followed by a space and a parameter | |
| robot.load scriptsPath | |
| # the function below will not be called | |
| robot.run | |
| # it must look like this | |
| robot.run() | |
| # i'd rather have a few more parentheses than this brain-jarring inconsistency |
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 crypto = require('crypto'); | |
| var http = require('http'); | |
| var querystring = require('querystring'); | |
| var url = require('url'); | |
| var util = require('util'); | |
| var accessID = 'xxxxx'; | |
| var key = 'xxxxxxxxxx'; | |
| var host = 'api.summon.serialssolutions.com'; | |
| var summon = http.createClient(80, host); |