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
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
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
{ | |
"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
{ | |
"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
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
:: you must have oggenc or lame codecs installed and available in your PATH | |
cd path/to/your/folder/of/wav/files/to/convert | |
:: replace BITRATE with what you need, and use either of the following lines: | |
for /F %v IN ('dir /b *.wav') DO oggenc -m BITRATE %v | |
for /F %v IN ('dir /b *.wav') DO lame -b BITRATE %v |
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
javascript:document.body.contentEditable='true'; document.designMode='on'; void 0 |
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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
public static class ListShuffle | |
{ | |
public static void Shuffle<T>(this IList<T> list) | |
{ | |
Random rand = new Random(); |
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
void str_append_from(char *original, int &idx, const char *append) { | |
while (*append) { | |
original[idx++] = *append++; | |
} | |
original[idx] = 0; | |
} |
OlderNewer