Skip to content

Instantly share code, notes, and snippets.

@ajesler
ajesler / led_lamp.ino
Last active November 13, 2016 20:51
Arduino sketch for a remote controllable LED lamp.
// IRLib from https://github.com/cyborg5/IRLib
#include <IRLib.h>
// RGBEffects from https://github.com/ajesler/Arduino-RGBEffects
#include <RGBEffects.h>
// if isPaused is true, update will stop being called until the lamp is unpaused.
int isPaused = 0;
// the time between effect updates.
int effect_delay = 2100;
@Karry
Karry / hdmi-monitor.sh
Last active August 22, 2019 22:33
Purpose of this script is to monitor HDMI state on my Raspberry PI and start XBMC / Kodi when output is plugged in and terminate it when it is unplugged. It is tested with Raspbian distribution and XBMC / Kodi compiled from git.
#!/bin/bash
## DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
## Version 2, December 2004
##
## Copyright (C) 2013 Lukáš Karas <lukas.karas@centrum.cz>
##
## Everyone is permitted to copy and distribute verbatim or modified
## copies of this license document, and changing it is allowed as long
## as the name is changed.
@kenelliott
kenelliott / my.cnf
Created November 6, 2012 16:05
16CPU / 16GB My.cnf
[mysqld_safe]
nice = -15
[mysqld]
max_binlog_size = 256M #max size for binlog before rolling
expire_logs_days = 1 #binlog files older than this will be purged
## Per-Thread Buffers * (max_connections) = total per-thread mem usage
thread_stack = 256K #default: 32bit: 192K, 64bit: 256K
sort_buffer_size = 1M #default: 2M, larger may cause perf issues

Following is a translation of a post by Kenta Cho (@abagames) about what he learned making 50 minigames in 2014. The original post is here:

http://d.hatena.ne.jp/ABA/20141223#p1

This translation is by Paul McCann (@polm23); please feel free to contact me with any comments or corrections.

The Secret to Creating Fun Games I Learned By Making 50 Games in a Year

... is that there isn't one.

@nybblr
nybblr / 1-easy.js
Last active July 13, 2022 03:40
3 examples of using Async Generators and Async Iteration in JavaScript!
// Create a Promise that resolves after ms time
var timer = function(ms) {
return new Promise(resolve => {
setTimeout(resolve, ms);
});
};
// Repeatedly generate a number starting
// from 0 after a random amount of time
var source = async function*() {
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@jongrover
jongrover / kiosk-pi.txt
Last active December 3, 2023 21:45
How to Kiosk Raspberry Pi
Software for the Project:
Raspbian Wheezy Debian Linux
Win32Disk Imager
The CanaKit comes with a pre-loaded SD card that includes the same version of Debian Wheezy that I used for this project. However, in an effort to get a little more speed out of the system, I used the 95MB/s Sandisk extreme listed above. It seemed to help, but I did not bench mark it beyond observation.
Anyway, lets get down to building a Raspberry Pi Web Kiosk.
Step 0: Get all of the hardware.
Step 1: Get all of the software.
@thoop
thoop / nginx.conf
Last active December 8, 2023 21:55
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
@sponomarev
sponomarev / command.sh
Created November 9, 2013 10:43
Remove iTerm2 icon from Dock
# remove
/usr/libexec/PlistBuddy -c 'Add :LSUIElement bool true' /Applications/iTerm.app/Contents/Info.plist
# restore
/usr/libexec/PlistBuddy -c 'Delete :LSUIElement' /Applications/iTerm.app/Contents/Info.plist
@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)