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
#!/bin/bash | |
npm install ts-node | |
npm install typescript | |
node test.js |
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
drop table FImage cascade; | |
drop table Tag cascade; | |
create table FImage(id integer primary key, url varchar(255)); | |
create table Tag(id integer primary key, text varchar(255)); | |
create table FImageTag(fimage_id integer references FImage(id), tag_id integer references Tag(id)); | |
insert into FImage(id, url) values(1, 'blah.com/im01.jpg'); | |
insert into FImage(id, url) values(2, 'blah.com/im02.jpg'); | |
insert into FImage(id, url) values(3, 'blah.com/im03.jpg'); | |
insert into FImage(id, url) values(4, 'blah.com/im04.jpg'); | |
insert into FImage(id, url) values(5, 'blah.com/im05.jpg'); |
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
#include <IRremote.h> | |
#define RECV_PIN 2; | |
#define B_1 0x92DF9279 | |
#define B_2 0x87CDD0EF | |
#define B_3 0x37788763 | |
IRrecv irrecv(RECV_PIN); | |
void setup() { | |
Serial.begin(9600); | |
Serial.println("Ready to decode IR!"); | |
irrecv.enableIRIn(); |
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
#!/usr/bin/env ruby | |
t=$*[0] | |
e='#'*79 | |
r='#'+' '*77+'#' | |
puts [e,r,t.scan(/.{1,40}/).map{|a|m=r.clone;l=(79-a.size)/2;m[l..(l+a.size-1)]=a;m},r,e].join "\n" |
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
npm install ts-node | |
npm install typescript | |
node test.js | |
# type in test.ts hit enter | |
# magic 🎩 |
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 setup() { | |
pinMode(17, OUTPUT); | |
} | |
void loop() { | |
digitalWrite(17, HIGH); | |
delay(100); | |
digitalWrite(17, LOW); | |
delay(100); | |
} |
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
zzz = 86 | |
p = random_prime(2^512); q = random_prime(2^512) | |
N = p*q | |
a = p % 2^zzz | |
X = 2^zzz | |
M = matrix([[X^2, 2*X*a, a^2], [0, X, a], [0, 0, N]]) | |
B = M.LLL() | |
x = PolynomialRing(RationalField(), 'x').gen() | |
Q = B[0][0]*x^2/X^2+B[0][1]*x/X+B[0][2] | |
foundp = a+Q.roots(ring=ZZ)[0][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
/* | |
* File: newmain.c | |
* Author: Ed | |
* | |
* Created on December 28, 2017, 11:44 PM | |
*/ | |
//#include <xc.h> | |
// |
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
#include "HID.h" | |
#define BUTTON1_PIN 2 | |
#define BUTTON2_PIN 3 | |
#define BUTTON3_PIN 4 | |
#define BUTTON4_PIN 5 | |
#define BUTTON5_PIN 6 | |
#define BUTTON6_PIN 7 | |
#define BUTTON7_PIN 8 | |
#define BUTTON8_PIN 9 |
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
#include "HID.h" | |
static const uint8_t _hidReportDescriptor[] PROGMEM = { | |
0x05, 0x01, // USAGE_PAGE (Generic Desktop) | |
0x09, 0x05, // USAGE (Game Pad) | |
0xa1, 0x01, // COLLECTION (Application) | |
0xa1, 0x00, // COLLECTION (Physical) | |
0x85, 0x03, // REPORT_ID (3) | |
0x05, 0x09, // USAGE_PAGE (Button) | |
0x19, 0x01, // USAGE_MINIMUM (Button 1) |