Skip to content

Instantly share code, notes, and snippets.

@mschnetzer
mschnetzer / covidmap.R
Created October 24, 2020 08:00
Entwicklung der Covid-Pandemie in Österreichs Bezirken (https://twitter.com/matschnetzer/status/1319904508386942976)
library(tidyverse)
library(sf)
library(gganimate)
library(transformr)
library(lubridate)
library(msthemes) # https://github.com/mschnetzer/msthemes
# Import online map
bezirke <- st_read("https://raw.githubusercontent.com/ginseng666/GeoJSON-TopoJSON-Austria/master/2017/simplified-99.9/bezirke_999_geo.json") %>%
mutate(iso = as.numeric(iso))
@ceres-c
ceres-c / CR95HF_ICODE_psw_dump.py
Created December 31, 2019 12:54
CR95HF Python script to read NXP ICODE tags in privacy mode
#!/usr/bin/python3
# Author: ceres-c 2019-12-29
# Authenticate to ICODE SLI tags
import hid
# Global defines & commands
password = [0x00, 0x00, 0x00, 0x00] # You have to find it yourself, try to search online in german ;-)
@NoraCodes
NoraCodes / esp8266_scan.ino
Last active October 18, 2022 10:35
Network scanner on ESP8266
/**
* ESP8266 Scanner - Scans for networks on the 2.4GHz band and prints them out to the console.
* Program it onto your ESP8266, pull up miniterm, the Serial Monitor, etc, and view a list of
* wireless networks on your computer.
* Requres Arduino JSON (http://arduinojson.org/), downloadable from Library Manager or GitHub.
* Or, set OUTPUT_JSON and consume the serial output with your favorite JSON parser.
*
* Created by Leonora Tindall in 2017 for the ESP8266.
* This software is licensed under the GNU General Public License, Version 3.0.
*/
@mrbar42
mrbar42 / README.md
Last active April 20, 2024 02:57
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
@PaulKinlan
PaulKinlan / waitForElement.js
Last active July 19, 2022 22:32
waitForElement.js
function waitForElement(selector) {
return new Promise(function(resolve, reject) {
var element = document.querySelector(selector);
if(element) {
resolve(element);
return;
}
var observer = new MutationObserver(function(mutations) {
@sndrs
sndrs / auto_nvm_use.sh
Last active March 18, 2024 11:29 — forked from jusopi/check.sh
Automatically set node version per project using .nvmrc file
# This will run `nvm use` everytime you change directory, if
# 1. an .nvmrc file is present
# 2. there is no .nvmrc but you're not using your default node
# Add it to your `.bash_profile` (or wherever else is suitable for your setup).
enter_directory(){
if [ "$PWD" != "$PREV_PWD" ]; then
PREV_PWD="$PWD";
if [ -e ".nvmrc" ]; then
nvm use;
@gbaman
gbaman / HowToOTG.md
Last active May 2, 2024 01:27
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@kriskowal
kriskowal / distributed-gol.txt
Created December 6, 2015 00:45
Pseudo code for distributed Game of Life
data
for every worker
owned chunks, those chunks that must be computed for each generation
neighbors, chunks that must be received to proceed to next generation
needed chunks = owned chunks + neighbors
for this generation on every worker
transmitted chunks
for the prior, current, and next generation on this worker
needed chunks, a snapshot of owned chunks and neighbor chunks for this worker, less any completed chunks
needed owned chunks, a snapshot of owned chunks for this worker, less any completed chunks
@Droogans
Droogans / bill.spec.js
Last active November 6, 2015 10:43
Exercising the buffalo module.
var _ = require('lodash'); // gotta use lodash for everything
var bill = require('buffalo');
var events = bill.events;
var conditions;
var victim;
/**
* TODO -- stop mixing promises and events, this API is really messed up.
*/
describe('suit construction', function () {
@revolunet
revolunet / python-es6-comparison.md
Last active April 22, 2024 19:22
# Python VS JavaScript ES6 syntax comparison

Python VS ES6 syntax comparison

Python syntax here : 2.7 - online REPL

Javascript ES6 via Babel transpilation - online REPL

Imports

import math