Skip to content

Instantly share code, notes, and snippets.

@edy555
edy555 / hdr.py
Created February 13, 2014 14:53
append header onto binary file for writing dfu-util
#!/usr/bin/env python
import struct
import sys
fin = open(sys.argv[1], 'rb')
fout = open(sys.argv[2], 'wb')
bin = fin.read()
fin.close()
@edy555
edy555 / gen-rainbow.py
Created September 16, 2014 15:35
Generate rainbow shape as voxel in json for VoxelEditor https://github.com/perfume-dev/VoxelEditor
#!/usr/bin/env python
import json
import colorsys
import math
def hsv(h, s, v):
r, g, b = colorsys.hsv_to_rgb(h, s, v)
return (int(r*255)*256 + int(g*255))*256 + int(b*255)
arr = []
@edy555
edy555 / spectrum.py
Last active August 29, 2015 14:09
Sound Spectrum Display using Laser Projector and OpenLASE
#!/usr/bin/env python
import pyaudio
import pylase as ol
import numpy as np
import sys
import threading
chunk = 1024
#chunk = 2048
CHANNELS = 2
@edy555
edy555 / pickit3-osx10.9.txt
Created November 27, 2014 23:57
PICkit3 system_profiler SPUSBDataType on Marvericks
PICkit 3:
Product ID: 0x900a
Vendor ID: 0x04d8 (Microchip Technology Inc.)
Version: 0.02
Serial Number: DEFAULT_PK3
Speed: Up to 12 Mb/sec
Manufacturer: Microchip Technology Inc.
Location ID: 0xfd120000 / 4
Current Available (mA): 500
@edy555
edy555 / blink.html
Created December 2, 2014 06:00
FlashAirでLチカ4種類。html+javascript, python, ruby, shell script http://youtu.be/GXY_FRvI-vY
@edy555
edy555 / fmpi.c
Created March 31, 2015 22:45
old source code of fmpi.co for raspi fm tx hack
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <dirent.h>
#include <math.h>
#include <fcntl.h>
#include <assert.h>
#include <malloc.h>
#include <sys/mman.h>
#include <sys/types.h>
undefined
undefined
undefined
@edy555
edy555 / openlase-osx-cmake.patch
Created March 16, 2012 17:26
patch to openlase for MacOSX with cmake
diff --git a/Modules/CMakeASM_YASMInformation.cmake b/Modules/CMakeASM_YASMInformation.cmake
index 50b2848..3d7b330 100644
--- a/Modules/CMakeASM_YASMInformation.cmake
+++ b/Modules/CMakeASM_YASMInformation.cmake
@@ -1,7 +1,13 @@
set(ASM_DIALECT "_YASM")
set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm)
-if(UNIX)
+if(APPLE)