Skip to content

Instantly share code, notes, and snippets.

View akey7's full-sized avatar

Alicia Key akey7

View GitHub Profile
@akey7
akey7 / gist:4583388
Created January 21, 2013 03:19
A client for the CW keyer hardware.
var net = require('net');
exports.send = function(message) {
var client = net.connect({host: '192.168.0.73', port: 73}, function() {
client.write(message);
client.end();
});
};
msgbox("hello message box")
msgbox("awesome for the office")
@akey7
akey7 / gist:4700599
Last active December 12, 2015 02:38
Customize TcpMorseCode/TcpMorseCode.ino to configure your device.
/*** BEGIN software configuration ***/
// CW_TICK_TIME_MILLISECONDS sets the fundamental "tick" time in for the
// morse code timing. Esseintially, it sets the words per minute WPM that
// it beeps out of the speaker.
//
// 56 ms is around 19 WPM, which is fairly fast
// 220 ms is closer to 6 WPM, better if you do not have prior experience
// with CW
#define CW_TICK_TIME_MILLISECONDS 56
@akey7
akey7 / gist:4700652
Created February 3, 2013 05:33
A simple test of the Arduino Morse Code device using telnet
$ telnet 192.168.0.73 73
Trying 192.168.0.73...
Connected to 192.168.0.73.
Escape character is '^]'.
HELLO WORLD
^]
telnet> quit
Connection closed.
@akey7
akey7 / RemoteMotorsNetworkCustomize.c
Created March 12, 2013 02:56
These are the lines you customize to your network configuration in RemoteMotors.
const int serverPort = 17;
EthernetServer server(serverPort);
byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0xD7, 0xD2 };
IPAddress gateway(192, 168, 0, 1);
IPAddress subnet(255, 255, 255, 0);
IPAddress ip(192, 168, 0, 33);
var controller_hostname = '192.168.0.33';
var controller_port = 17;
@akey7
akey7 / ble-events.js
Created October 25, 2013 22:52
BLE event handlers in JS
// There are some contrived things in here, but if you are talking about putting handlers in aan array, this may help you.
var allBleDevices = [];
function genericBleEventHanlder(ble_device, event) {
// Do something with the event
}
function makeSpecificBleHandler(bleDevice) {
return (function(bleDevice, event) {
@akey7
akey7 / autosized-button.m
Created December 4, 2013 23:33
How to make a button with a label and then size it to fit.
UIButton *button2 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
button2.frame = CGRectMake(10, 100, 100, 75);
[button2 setTitle:@"supercalifragelisticexpialidocious" forState:UIControlStateNormal];
[button2 sizeToFit];
@akey7
akey7 / obj-c.gitignore
Created February 27, 2014 03:09
Objective-C gitignore
# Xcode
.DS_Store
*/build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
@akey7
akey7 / gitconfig.gitconfig
Created February 27, 2014 04:50
git configuration
[core]
editor = vim
[alias]
co = checkout
ct = commit
ss = status
br = branch
me = merge
ph = push
pl = pull