Skip to content

Instantly share code, notes, and snippets.

Avatar
🏜️
🚙🛸🌵🛰

Bret bcomnes

🏜️
🚙🛸🌵🛰
View GitHub Profile
@bcomnes
bcomnes / index.js
Created Mar 5, 2014
node sudo hardware code
View index.js
devices = {
devArduino: {
port: '/dev/tty.usbserial-A800ewsy'
function: 'stage'
},
stageArduino: {
port: '/dev/tty.usbmodem3d11',
function: 'stage'
},
scopeSerial: {
View keybase.md

Keybase proof

I hereby claim:

  • I am bcomnes on github.
  • I am bret (https://keybase.io/bret) on keybase.
  • I have a public key whose fingerprint is CF24 7B7A ABD0 67AE 3DCC 320A 0BCF 329D 5622 03D9

To claim this, I am signing this object:

View serialTest
var serialport = require('serialport');
var SerialPort = serialport.SerialPort;
var replify = require('replify');
var serialPort = new SerialPort('/dev/cu.PL2303-0000101D', {
baudrate: 2400,
parser: serialport.parsers.readline('\r')
});
serialPort.on('open', function () {
View gist:5cbf5d5c5454362e9020
> serialPort.list(function (err, ports) { console.log(ports) });
undefined
> [ { comName: 'COM5',
manufacturer: 'Gigaware',
serialNumber: '',
pnpId: 'USB\\VID_05AD&PID_0FBA\\5&C663B7B&0&1',
locationId: '',
vendorId: '',
productId: '' } ]
@bcomnes
bcomnes / pdx.devweek.org
Last active Aug 29, 2015
CFP PDX dev week
View pdx.devweek.org
@bcomnes
bcomnes / index.html
Created Jul 14, 2014
Select styles with CSS only - JS Bin http://jsbin.com/juvixufu/168/edit
View index.html
<html>
<head>
<title>Select styles with CSS only</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
background-color: #fff;
font-family: helvetica, sans-serif;
margin: 4% 10%
}
@bcomnes
bcomnes / example.sh
Created Jul 22, 2014
Trying to write tests for xylib
View example.sh
arc-mac-04:samples bcomnes$ echo "20.0 490.5" > test.txt
arc-mac-04:samples bcomnes$ cat test.txt
20.0 490.5
arc-mac-04:samples bcomnes$ xyconv -g test.txt
text: ascii text
@bcomnes
bcomnes / hw3.lhs
Created Aug 14, 2014
Just just haskell Ted gave to me
View hw3.lhs
------------------------------------------------------------------------
CS457/557 Functional Languages, Winter 2014 Homework 3
------------------------------------------------------------------------
> import Control.Applicative((<$>),(<*>))
> import Data.List(intersperse, transpose)
> import Test.QuickCheck(quickCheck)
> import Test.QuickCheck.Arbitrary(Arbitrary, arbitrary)
> import Test.QuickCheck.Gen(choose, vectorOf)
@bcomnes
bcomnes / package.json
Created Sep 4, 2014
a nice package.json example
View package.json
{
"name": "flash",
"description": "",
"version": "0.0.0",
"author": {
"name": "Jonathan Ong",
"email": "me@jongleberry.com",
"url": "http://jongleberry.com",
"twitter": "https://twitter.com/jongleberry"
},
View baseline.sh
#!/bin/bash
# assumes a fairly recent Ubuntu - may work on Debian or others but needs testing
# assumes you have your .ssh/config setup to specify a user and key for the host
HOST=$1
ssh root@${HOST} "sed -i .backup -e 's/PermitRootLogin\syes/PermitRootLogin no/' /etc/ssh/sshd_config"
ssh root@${HOST} "sed -i .backup -e 's/#PasswordAuthentication\syes/PasswordAuthentication no/' /etc/ssh/sshd_config"
ssh root@${HOST} "sed -i .backup -e 's/X11Forwarding\syes/X11Forwarding no/' /etc/ssh/sshd_config"