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
some_fun(req, res, next) | |
.pipe(function() { return redis.incr('next_id') }) | |
.fail(function(e) { return next(e); }) | |
.pipe(function() { return redis.set('key', {id:r, now:Date.now()}) }) | |
.done(function(res) {res.send([1, 'ok'];}) | |
.fail(function(e) {return next(e); }) |
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
String tmp = ""; | |
void setup() { | |
Serial.begin(9600); | |
} | |
void loop() { | |
while (Serial.available() > 0) { | |
tmp += char(Serial.read()); |
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
const int ledPin = 9; // the pin that the LED is attached to | |
void setup() | |
{ | |
// initialize the serial communication: | |
Serial.begin(9600); | |
// initialize the ledPin as an output: | |
pinMode(ledPin, OUTPUT); | |
} |
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
#include <SoftwareSerial.h> | |
SoftwareSerial mySerial(9, 10); //RX,TX | |
String tmp; | |
void setup() { | |
Serial.begin(9600); | |
mySerial.begin(9600); | |
}; |
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
gollum-site generate | |
cp _site/Home.html _site/index.html | |
rm -rf /tmp/_site | |
cp -r _site /tmp/ | |
git co gh-pages | |
rsync -av /tmp/_site/ . | |
git add . | |
git commit -a -m"add" | |
git push | |
git co gollum |
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
#include <SoftwareSerial.h> | |
SoftwareSerial mySerial(11, 12); //RX,TX | |
String tmp; | |
void setup() { | |
Serial.begin(9600); | |
mySerial.begin(9600); | |
while (!Serial) { |
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 hook does two things: | |
# | |
# 1. update the "info" files that allow the list of references to be | |
# queries over dumb transports such as http | |
# | |
# 2. if this repository looks like it is a non-bare repository, and | |
# the checked-out branch is pushed to, then update the working copy. | |
# This makes "push" function somewhat similarly to darcs and bzr. |
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
int RXLED = 17; // The RX LED has a defined Arduino pin | |
// The TX LED was not so lucky, we'll need to use pre-defined | |
// macros (TXLED1, TXLED0) to control that. | |
// (We could use the same macros for the RX LED too -- RXLED1, | |
// and RXLED0.) | |
void setup() | |
{ | |
pinMode(RXLED, OUTPUT); // Set RX LED as an output | |
// TX LED is set as an output behind the scenes |
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
[Unit] | |
Description=/etc/rc.local Compatibility | |
ConditionPathExists=/etc/rc.local | |
[Service] | |
Type=forking | |
ExecStart=/etc/rc.local | |
TimeoutSec=0 | |
StandardOutput=tty | |
RemainAfterExit=yes |
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
String tmp; | |
void setup() { | |
Serial.begin(115200); | |
Serial1.begin(115200); | |
while (!Serial) { | |
; // wait for serial port to connect. Needed for Leonardo only | |
} | |
Serial.println("hello!"); |