Skip to content

Instantly share code, notes, and snippets.

View imrehg's full-sized avatar
🐒
Chaos Monkey

Gergely Imreh imrehg

🐒
Chaos Monkey
View GitHub Profile
@imrehg
imrehg / neon_gallop.ino
Created February 18, 2014 04:36
Galloping horse neon light driver
// Galloping horse display
// Instructables Build Night with Cool Neon
const int p[] = {13, 12}; // List of pins with connected EL wires
const int pn = 2; // number of connected wires
const int delay = 400; // delay between display updates
void setup() {
delay(200);
for( int i = 0 ; i < pn ; i++ ) { // declare all the Cool Neon channels as outputs
@imrehg
imrehg / neon_beats.ino
Created February 18, 2014 04:18
Electroluminescent beat to the music
// Beat to the music
// Instructables Build Night with Cool Neon
const int p[] = {13, 12, 11, 10, 9}; // List of pins with connected EL wires
const int pn = 5; // number of connected wires
void setup() {
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
@imrehg
imrehg / neon_blink.ino
Created February 18, 2014 03:19
Blinking electroluminescent wire
@imrehg
imrehg / 2of3.md
Last active January 2, 2016 16:39 — forked from anonymous/2of3.md

2-of-3 Escrow Example with Electrum

This is gmaxwell's 2-of-2 escrow example, adapted to Electrum and to a lesser extent, GFM.

The Scenario

Archey wants to pay Bertha 0.001 BTC for a Twitter Platinum invite, but prevent Bertha from cheating him. Archey selects Iceland to act as

@imrehg
imrehg / Automation.py
Created October 25, 2013 05:18
Automation
##################################
from vcScript import *
comp = getComponent()
def OnSignal( signal ):
global componentEntering, queue, portIndex
# When component is trying to pass the transfer the index of the port is added to request queue
if signal == componentEntering:
queue.append([portIndex.Value, componentEntering.Value]) # list of lists ~ [index, part]
@imrehg
imrehg / QREncrypter.cs
Last active December 16, 2020 08:46
QR code encryption code for Taiwanese electronic invoice
namespace tw.gov.nat.einvoice.qrutil {
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
public class QREncrypter {
public string AESEncrypt(string plainText, string AESKey) {
byte[] bytes = Encoding.Default.GetBytes(plainText);
ICryptoTransform transform = new RijndaelManaged { KeySize = 0x80, Key = this.convertHexToByte(AESKey), BlockSize = 0x80, IV = Convert.FromBase64String("Dt8lyToo17X/XkXaQvihuA==") }.CreateEncryptor();
We can't make this file beautiful and searchable because it's too large.
#Unix timestamp, temperature (C), pressure (Pa)
1373521583.53,27.9,100676
1373521583.54,27.9,100673
1373521583.55,27.9,100685
1373521584.23,27.9,100682
1373521585.24,27.9,100664
1373521586.26,27.9,100676
1373521587.27,27.9,100670
1373521588.28,27.9,100679
1373521589.30,27.9,100679
@imrehg
imrehg / likes.py
Created May 3, 2013 03:15
Facebook likes from web sent to wireless Arduino
import urllib2 # for requests
import simplejson # for JSON conversion
import sys # for command line arguments
import time # for delays
# Get the page FB ID string from 1st command line argument
pagename = sys.argv[1]
# Download the page data into python dict
url = "http://graph.facebook.com/%s" %(pagename)
countries = [
{'timezones': ['Europe/Andorra'], 'code': 'AD', 'continent': 'Europe', 'name': 'Andorra', 'capital': 'Andorra la Vella'},
{'timezones': ['Asia/Kabul'], 'code': 'AF', 'continent': 'Asia', 'name': 'Afghanistan', 'capital': 'Kabul'},
{'timezones': ['America/Antigua'], 'code': 'AG', 'continent': 'North America', 'name': 'Antigua and Barbuda', 'capital': "St. John's"},
{'timezones': ['Europe/Tirane'], 'code': 'AL', 'continent': 'Europe', 'name': 'Albania', 'capital': 'Tirana'},
{'timezones': ['Asia/Yerevan'], 'code': 'AM', 'continent': 'Asia', 'name': 'Armenia', 'capital': 'Yerevan'},
{'timezones': ['Africa/Luanda'], 'code': 'AO', 'continent': 'Africa', 'name': 'Angola', 'capital': 'Luanda'},
{'timezones': ['America/Argentina/Buenos_Aires', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/Tucuman', 'America/Argentina/Catamarca', 'America/Argentina/La_Rioja', 'America/Argentina/San_Juan', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Ushuai
http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=1578584&abstractAccess=no&userType=inst
http://ieeexplore.ieee.org/Xplore/defdeny.jsp?url=http%3A%2F%2Fieeexplore.ieee.org%2Fstamp%2Fstamp.jsp%3Ftp%3D%26arnumber%3D1300723%26userType%3Dinst&denyReason=-134&arnumber=1300723&productsMatched=null&userType=inst
http://ieeexplore.ieee.org/Xplore/defdeny.jsp?url=http%3A%2F%2Fieeexplore.ieee.org%2Fstamp%2Fstamp.jsp%3Ftp%3D%26arnumber%3D800029%26userType%3Dinst&denyReason=-134&arnumber=800029&productsMatched=null&userType=inst
###
http://www.ixys.com/PSpice_Model/IGBT_TYPE/Discrete_IGBT_High_Speed_Series.html
http://www.electronicspoint.com/igbt-model-ltspice-t43052.html
http://www.st.com/web/en/catalog/sense_power/FM100/CL826
http://www.infineon.com/cms/en/product/igbts/igbt-with-anti-parallel-diode/channel.html?channel=ff80808112ab681d0112ab6a6bd104f4
http://www.hindawi.com/journals/apec/1998/089240/abs/