Skip to content

Instantly share code, notes, and snippets.

@hiorws
hiorws / web-servers.md
Created July 28, 2020 12:02 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@hiorws
hiorws / OpenSimplexNoise.java
Created May 23, 2020 17:48 — forked from KdotJPG/OpenSimplex2S.java
Visually axis-decorrelated coherent noise algorithm based on the Simplectic honeycomb.
/*
* OpenSimplex Noise in Java.
* by Kurt Spencer
*
* v1.1 (October 5, 2014)
* - Added 2D and 4D implementations.
* - Proper gradient sets for all dimensions, from a
* dimensionally-generalizable scheme with an actual
* rhyme and reason behind it.
* - Removed default permutation array in favor of
@hiorws
hiorws / face-detection.py
Created May 12, 2020 16:43 — forked from bookjan/face-detection.py
Using python opencv to detect face and send the frames to FFmpeg to create HLS(HTTP Live Streaming)
import numpy as np
import cv2
import sys
cap = cv2.VideoCapture(0)
face_cascade = cv2.CascadeClassifier('<PATH_TO_CASCADES_FOLDER>/haarcascade_frontalface_default.xml')
while(True):
# Capture frame-by-frame
@hiorws
hiorws / opencv_webcam_multithread.py
Created May 6, 2020 21:36 — forked from allskyee/opencv_webcam_multithread.py
opencv python camera frame grab and display on different threads with safe synchronization
#!/usr/bin/env python
from threading import Thread, Lock
import cv2
class WebcamVideoStream :
def __init__(self, src = 0, width = 320, height = 240) :
self.stream = cv2.VideoCapture(src)
self.stream.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, width)
self.stream.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, height)
@hiorws
hiorws / springer_books_download.sh
Created April 29, 2020 20:16
Spring Books Download
wget "https://link.springer.com/content/pdf/10.1007/978-1-4842-4932-1" -O "Programming Persistent Memory.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-981-15-2429-5" -O "Forensic Genetics in the Governance of Crime.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-981-13-8437-0" -O "Autistic Community and the Neurodiversity Movement.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-981-13-8491-2" -O "Updates on Myopia.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-3-030-41882-3" -O "Audacious Education Purposes.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-3-030-29509-7" -O "The Future of Software Quality Assurance.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-981-15-0749-6" -O "Understanding China’s School Leadership.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-981-15-3053-1" -O "Educational Change Amongst English Language College Teachers in China.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-3-03
@hiorws
hiorws / covid19-tmux-dashboard.md
Created April 3, 2020 14:41 — forked from p0bailey/covid19-tmux-dashboard.md
Covid19 Tmux Dashboard
@hiorws
hiorws / sonarqube-docker-compose.yml
Created February 17, 2020 11:09 — forked from Warchant/sonarqube-docker-compose.yml
docker-compose file to setup production-ready sonarqube
version: "3"
services:
sonarqube:
image: sonarqube
expose:
- 9000
ports:
- "127.0.0.1:9000:9000"
networks:
@hiorws
hiorws / README.md
Created October 27, 2019 03:16 — forked from xavriley/README.md
Original NES Mario Theme for Sonic Pi

Making Chiptune Music using Sonic Pi v2.0

Warning: this might not work on a RaspberryPi yet

I was curious about making retro gaming sounds using Sonic Pi. A couple of months and a lot of Googling later, here's the original Mario Bros theme as it was heard on the NES console.

I'm (just about) old enough to remember rushing home from school to play this game at Philip Boucher's house, sitting cross-legged in front of the TV till my feet got pins and needles. Working out how to recreate it for Sonic Pi was a lot of fun!

Getting the sounds of the NES chip

@hiorws
hiorws / trap3.rb
Created October 22, 2019 20:42 — forked from interstar/trap3.rb
Trap beat for sonic pi
use_bpm 145
# Our chord sequence
p1 = [chord(:E3,"minor7"),
chord(:G3,"major7"),
chord(:A3,"minor7"),
chord(:G3,"m9"),
chord(:E3,"m9"),
chord(:C3,"minor7"),
#Program to drive Sonic Pi 3 visualiser written in "processing"
#by Robin Newman, September 2017
#see article at https://rbnrpi.wordpress.com
#set up OSC address of processing sketch
use_osc '127.0.0.1',5000
#select shapes to show
osc "/viz/shapes","e" #"s" "e" "r" Star,Ellipse, Rectangle or combination
sleep 0.1
live_loop :c do