Skip to content

Instantly share code, notes, and snippets.

View Bluebie's full-sized avatar

Phoenix Fox Bluebie

View GitHub Profile
@Bluebie
Bluebie / account.js
Created November 2, 2019 09:47
Partially encrypted account model for IPFS app
// Model to represent an account in the distributed database
// Accounts are mainly a place users can store information like their private keys, in a password protected
// vault, so they can login conveniently from other devices and keep hold of their private keys and record
// what blogs they are authors of. It's also a way for other users to lookup an authors public keys to validate
// their other objects when determining if a new version of some data really belongs to the blog it claims to be
// related to.
const nacl = require('tweetnacl')
const cbor = require('borc')
class HSAccount {

Keybase proof

I hereby claim:

  • I am bluebie on github.
  • I am bluebie (https://keybase.io/bluebie) on keybase.
  • I have a public key ASCgMTSUFbR1ZlH8cPTb1bsQkaFXif9Ff2bSjhuF5WryGgo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am bluebie on github.
  • I am bluebie (https://keybase.io/bluebie) on keybase.
  • I have a public key whose fingerprint is BC03 3A29 A2DB 75F0 DBA5 AC97 EA55 CE0A E1BA DE23

To claim this, I am signing this object:

@Bluebie
Bluebie / output.txt
Created September 6, 2012 03:40
avrdude inside vmware fusion output
C:\Users\Blix\Desktop>embedded-creations-USBaspLoader-tiny85-8445e3b\software\av
rdude-5.11.1-tiny85mods\avrdude.exe -c usbasp -p t85 -U flash:w:firmware.hex
avrdude.exe: warning: cannot set sck period. please check for usbasp firmware up
date.
avrdude.exe: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude.exe: Device signature = 0x1e930b
@Bluebie
Bluebie / avrdude output
Created September 5, 2012 23:46
Output of modified avrdude build trying to upload to USBaspLoader-tiny85
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e930b
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
[1] pry(main)> my = ['a', 'b', 'c']
=> ["a", "b", "c"]
[2] pry(main)> (lambda {|a b c| puts a, b, c}).call(*my)
[2] pry(main)*
@Bluebie
Bluebie / lay-test.js
Created September 16, 2011 06:17
Lay - a simple kind of class-ish object constructor kit for modern javascript
// tests lay
var LayTest1 = lay({
constructor: function(g, d) { this.g = d, this.d = g; },
gud: function() { return this.d + 'u' + this.g; },
isGud: function() { return false; }
});
var LayTest2 = lay({
atop: LayTest1.prototype,
constructor: function(f,o,o) { this.foo = 'bats'; return this.atop('constructor', f, 'd'); },
// -=- Angular Deplexer -=-
// A little chip to take multiplexed PPM
// signals, and split them up over the
// digital pins, for RC things, and
// fun little cassette tape robots!
// <3 Bluebie
// And now for some settings...
const byte input = 0; // Which analog input should I use?
const byte outputs = 10; // How many outputs maximum?
require 'rubygems'
require 'ruby-audio'
# Info at http://www.horrorseek.com/home/halloween/wolfstone/Motors/svoint_RCServos.html
class ServoAnimation
SampleRate = 48000 # samples per second
RePulse = 200 # hertz
CentreWidth = 1.5 # mSec
ScaleWidth = 0.9 # mSec
PulseEvery = SampleRate / RePulse
// In this example, the private_thing is more like a private class variable than a private instance variable.
var F=function(){
var private_thing = '';
this['private_thing'] = function(){ return private_thing; }; // get…
this['set_private_thing'] = function(o){ private_thing = o; }; // set…
this['public_thing'] = '';
};