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 | |
if [ $# -ge 2 ]; then | |
USER=$1 | |
SERVER=$2 | |
DIR=${MOUNT_SSHFS__ROOT_DIR:-/var/tmp/mount-sshfs}/$SERVER | |
# it's possible to use primary or clip | |
XCLIP_SEL_MODE=${MOUNT_SSHFS__XCLIP_SEL_MODE:-primary} | |
if [ -d $DIR ]; then | |
if [ $# -eq 3 -a "$3" = "kill" ]; then |
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/bash | |
DATE=`date +"%Y%m%d%H%M%S"` | |
INSTALL_DIR=node_${DATE} | |
mkdir $INSTALL_DIR | |
cd $INSTALL_DIR | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xzv --strip-components=1 | |
export JOBS=2 |
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
L.Google = L.Class.extend({ | |
includes: L.Mixin.Events, | |
options: { | |
minZoom: 0, | |
maxZoom: 18, | |
tileSize: 256, | |
subdomains: 'abc', | |
errorTileUrl: '', | |
attribution: '', |
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
<meta http-equiv="content-Type" content="text/html; charset=utf-8" /> | |
<meta http-equiv="content-Language" content="cs" /> | |
<style> | |
div.qr-code { | |
clear: left; | |
} | |
img.qr-code { | |
float: left; | |
margin-bottom: 50px; | |
} |
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
# ... with if/else | |
class Pirate | |
if century > 1700 | |
loot: -> | |
say 'Give me the gold!' | |
else | |
loot: -> | |
say 'Dame el oro!' |
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
http.createServer(function(req, res) { | |
var d = domain.create(); | |
d.add(req); | |
d.add(res); | |
d.on('error', function(er) { | |
console.error('Error', er, req.url); | |
d.dispose(); | |
}); | |
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/env bash | |
SCRIPT_PATH=$(readlink -f $0) | |
DIR=$(dirname $SCRIPT_PATH) | |
PID_DIR="${DIR}/pid" | |
LOG_DIR="${DIR}/log" | |
DAEMON_PID_FILE="${PID_DIR}/daemon.pid" | |
DAEMON_LOG_FILE="${LOG_DIR}/daemon.log" | |
PROCESS_PID_FILE="${PID_DIR}/process.pid" |
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 | |
wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip |
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/env node | |
var fs = require('fs'); | |
var gpio = require("gpio"); | |
var gpio10 = gpio.export(10, { | |
direction: "out", | |
ready: function() { | |
function readTemperature() { | |
var data = fs.readFileSync('/sys/bus/w1/devices/28-0000047c275a/w1_slave', { encoding: 'ascii' }); | |
var temperature; |
OlderNewer