This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var C = { | |
regCalibStart: 0x88, | |
regChipID: 0xd0, | |
regReset: 0xe0, | |
regCalibStart2: 0xe1, | |
regCtrlHum: 0xf2, | |
regStatus: 0xf3, | |
regCtrlMeas: 0xf4, | |
regConfig: 0xf5, | |
regMeasurementsStart: 0xf, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IUserNancyModule { User CurrentUser { get; set; } } | |
public static class Hooks { | |
public static Func<NancyContext, Response> SetUserFromRequest(IUserNancyModule module, IAttensiContext db) { | |
return (ctx) => { | |
var usr = db.Users.FirstOrDefault(u=>u.EmployeeId == ctx.CurrentUser.UserName); | |
if (usr!=null) { | |
module.CurrentUser = usr; | |
return null; //let request pass | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"path": "C:/dev/Python27", | |
"cmd": ["python", "$file"], | |
"file_regex": "^[ ]*File \"(…*?)\", line ([0-9]*)", | |
"selector": "source.python" | |
} | |
/* | |
print "hello world" | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"path": "C:/Program Files (x86)/clisp-2.48/", | |
"cmd": ["clisp", "-i $file -x (main())"], | |
"selector": "source.lisp" | |
} | |
/* | |
(defun main (args) | |
(print "hello world") | |
(quit))*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int NUMBER_OF_ZONES = 19; | |
const int DOOR_OPEN_MS = 5 * 1000; // 5 seconds | |
const int ZONE_ON_MS = 10 * 60 * 1000; // 10 minutes | |
unsigned int zoneLastOn[NUMBER_OF_ZONES] = {}; | |
void loop() { | |
//this is the multitasking part | |
//we just check the time that has passed since | |
//we last wanted it on and act accordingly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.IdentityModel.Protocols.WSTrust; | |
using Microsoft.IdentityModel.Protocols.WSTrust.Bindings; | |
using System.ServiceModel; | |
using System.ServiceModel.Security; | |
using System.IdentityModel.Tokens; | |
string stsEndpoint = "https://YOURURL.com/adfs/services/trust/13/usernamemixed"; | |
string relyingPartyUri = "https://attensi.com"; | |
WSTrustChannelFactory factory = new WSTrustChannelFactory( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
BEAT BLINKER | |
Simple demo of how to use two processing units | |
to implement a 'used to be' hard problem | |
*/ | |
Microphone mic = Microphone(2, 8000); //pin 2 samplerate 8000 ? | |
Filter lowPass = LowPassFilter(100); | |
Threshold threshold = Threshold(50); //50% | |
LED beatBlinker = LED(WLED); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PropertyTester { | |
public: | |
PropertyTester() | |
: threshold() | |
, increment(PropertyTester::incrementAssignSafetyGuard) | |
, isIncrementing(_isIncrementing) { | |
_isIncrementing = true; | |
} | |
Property<int> threshold; | |
ConstrainedProperty<int> increment; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
|| | |
|| @author Alexander Brevig <abrevig@wiring.org.co> | |
|| @url http://wiring.org.co/ | |
|| @contribution Brett Hagman <bhagman@wiring.org.co> | |
|| @contribution Hernando Barragan <b@wiring.org.co> | |
|| | |
|| @description | |
|| | A public field wrapper for providing assignment safe guards | |
|| # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class Mobilephonizer : MonoBehaviour | |
{ | |
public AudioClip clip; | |
[RangeAttribute(0,20000)] | |
public int lowFrequencyCutoff = 1000; | |