Skip to content

Instantly share code, notes, and snippets.

View vicatcu's full-sized avatar

Victor Aprea vicatcu

View GitHub Profile
int gpio0 = 21;
int enable = 23;
enum {uart, flash} mode = flash;
void setup() {
Serial.begin(115200);
if(mode == flash){
Serial1.begin(76800);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.setDebugOutput(true);
}
void loop() {
// put your main code here, to run repeatedly:
}
0000: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0010: 0x00 0x72 0x00 0x46 0xFE 0xFF 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0020: 0x10 0x33 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0030: 0x00 0x41 0x00 0x46 0xFE 0xFF 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0040: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0050: 0x12 0xD1 0xFF 0x29 0x51 0x39 0x61 0x31 0x95 0xF6 0x20 0xE8 0x03 0x30 0x32 0xA0
0060: 0x38 0x03 0x49 0x71 0xA0 0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0070: 0x40 0x41 0x00 0x46 0xFE 0xFF 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0080: 0x06 0x08 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x40 0x1F 0x21 0x22 0x22
0090: 0x00 0x00 0x00 0xE0 0xF3 0x00 0x00 0x40 0x28 0xE3 0x00 0x40 0x00 0x00 0x00 0x00
var commandList = ["a", "b", "c"];
var commandFuncs = [];
for(var i = 0; i < commandList.length; i++){
var cmd = commandList[i];
commandFuncs.push( function(callback){
setTimeout(function(){
console.log(cmd);
callback(null);
}, 500);
J:\Users\VIC\Documents\Arduino\libraries\WildFire_CC3000_Library\utility\wlan.cpp:634: warning: comparison between signed and unsigned integer expressions
J:\Users\VIC\Documents\Arduino\libraries\WildFire_CC3000_Library\utility\wlan.cpp:658: warning: comparison between signed and unsigned integer expressions
J:\Users\VIC\Documents\Arduino\libraries\WildFire_CC3000_Library\utility\wlan.cpp:664: warning: comparison between signed and unsigned integer expressions
J:\Users\VIC\Documents\Arduino\libraries\WildFire_CC3000_Library\utility\wlan.cpp:695: warning: comparison between signed and unsigned integer expressions
J:\Users\VIC\Documents\Arduino\libraries\WildFire_CC3000_Library\utility\wlan.cpp:696: warning: comparison between signed and unsigned integer expressions
J:\Users\VIC\Documents\Arduino\libraries\WildFire_CC3000_Library\utility\wlan.cpp: In function 'long int wlan_ioctl_set_scan_params(long unsigned int, long unsigned int, long unsigned int, long unsigned int, long unsigned int, long int, long unsigne
Using previously compiled: J:\Users\VIC\AppData\Local\Temp\build1787282909712164483.tmp\Adafruit_CC3000_Library\utility\security.cpp.o
Using previously compiled: J:\Users\VIC\AppData\Local\Temp\build1787282909712164483.tmp\Adafruit_CC3000_Library\utility\sntp.cpp.o
Using previously compiled: J:\Users\VIC\AppData\Local\Temp\build1787282909712164483.tmp\Adafruit_CC3000_Library\utility\socket.cpp.o
Using previously compiled: J:\Users\VIC\AppData\Local\Temp\build1787282909712164483.tmp\Adafruit_CC3000_Library\utility\wlan.cpp.o
Using previously compiled: J:\Users\VIC\AppData\Local\Temp\build1787282909712164483.tmp\WildFire_CC3000_Library\ccspi.cpp.o
Using previously compiled: J:\Users\VIC\AppData\Local\Temp\build1787282909712164483.tmp\WildFire_CC3000_Library\WildFire_CC3000.cpp.o
Using previously compiled: J:\Users\VIC\AppData\Local\Temp\build1787282909712164483.tmp\WildFire_CC3000_Library\WildFire_CC3000_Server.cpp.o
Using previously compiled: J:\Users\VIC\AppData\Local\Temp\build178728290971216
def enforce_at_most_one_open_for_user
new_end_date = self.start.prev_day
if !self.user.nil?
self.user.memberships.each do |m|
if m.id != self.id && m.nil?
go.nil
m.end = new_end_date
m.save!
end
Failures:
1) Membership when a membeship is created if there are other memberships associated with user sets the end date for any of them that have a nil end date
Failure/Error: expect(Membership.find_by(start: Date.parse("2012-11-15")).end).not_to be_nil
expected: not nil
got: nil
# ./spec/models/membership_spec.rb:35:in `block (4 levels) in <top (required)>'
require 'rails_helper'
RSpec.describe Membership, :type => :model do
let!(:user) { FactoryGirl.create(:user, gnucash_id: "FOO")}
let!(:membertype) { FactoryGirl.create(:membership_type, name: "BAR", monthlycost: 23)}
let!(:membership) { FactoryGirl.create(:membership, user: user, membership_type: membertype,
start: Date.parse("2012-11-15")) }
subject { membership }