Skip to content

Instantly share code, notes, and snippets.

View makenai's full-sized avatar

Pawel Szymczykowski makenai

  • Codingscape
  • Nagoya, JP
View GitHub Profile
#!/bin/bash
SCREEN_COUNT=0
echo Capture started on `date`
echo Capture started on `date` >> log.txt
trap ctrl_c INT
function ctrl_c() {
echo Capture ended on `date` with $SCREEN_COUNT screens captured.
echo Capture ended on `date` with $SCREEN_COUNT screens captured. >> log.txt
exit
}
1. Design Your Own
If you are willing / able to learn some 3D design skills, that might be the most flexible
option. With a design and a 3D printer, you can design pretty much any kind of enclosure
you can imagine and modify it as your project evolves.
Here's a good tutorial about designing enclosures from Ben Heck:
https://www.youtube.com/watch?v=03Ju_LJlU3U
~/Projects/johnny-five (addSparkFunGPS ✔) ᐅ node eg/gps-sparkfun.js
1459460646988 Device(s) /dev/cu.usbmodem1421
1459460646997 Connected /dev/cu.usbmodem1421
1459460657001 Device or Firmware Error A timeout occurred while connecting to the Board.
Please check that you've properly flashed the board with the correct firmware.
See: https://github.com/rwaldron/johnny-five/wiki/Getting-Started#trouble-shooting
If connecting to a Leonardo or Leonardo clone, press the 'Reset' button on the board, wait approximately 11 seconds for complete reset, then run your program again.
events.js:146
#include <SoftwareSerial.h>
SoftwareSerial gpsSerial(10, 11);
const int sentenceSize = 80;
char sentence[sentenceSize];
void setup()
{
Serial.begin(9600);
@makenai
makenai / testCase.js
Created March 13, 2016 22:56
Temporal queue plus servo timings.
var five = require("johnny-five");
var temporal = require('temporal');
var board = new five.Board({
debug: false
});
// Outputs:
// ---
// node testCase.js
var Poll = React.createClass({
getInitialState: function() {
return {
question: {
title: ''
}
}
},
componentDidMount: function(data) {
$.get('/yourDataURL/' + this.props.id, function(data) {
@makenai
makenai / rollupSchema1.json
Last active August 29, 2015 14:27
Data Rollup Table Attempt #1
{
"_id": "The unique user id or session id",
"value": {
"Anonymous": "user is anonymous or logged in",
"HasTwitter": "user has a twitter account",
"HasFacebook": "user has a facebook account",
"EmailDomain": "email domain of the user",
"QuestionsCreated": "Count of questions created by the user",
"VotesReceived": "Total number of votes received on the user questions",
"AvgVotesReceived": "Average number of votes per question received",
@makenai
makenai / gist:8fa425316db85e8c73e2
Created April 30, 2015 18:26
Incremental JSHint and LintSpaces checking
var JAVASCRIPT_FILES = ['lib/**/*.js', 'routes/**/*.js', 'public/js/**/*.js'];
grunt.initConfig({
jshint: {
options: {
reporter: require('jshint-stylish'),
force: true,
/* https://github.com/gruntjs/grunt-contrib-jshint
http://jshint.com/docs/options/ */
},
@makenai
makenai / Arduino
Created June 24, 2014 05:28
SumoBot Code
#include <Scout.h>
#include <SPI.h>
#include <Wire.h>
#include <Scout.h>
#include <GS.h>
#include <bitlash.h>
#include <lwm.h>
#include <js0n.h>
#include <NESpad.h>
var five = require("johnny-five");
var Spark = require("spark-io");
var keypress = require('keypress');
var board = new five.Board({
io: new Spark({
token: "{YOURS}",
deviceId: "{YOURS}"
})
});