Skip to content

Instantly share code, notes, and snippets.

@nstarke
nstarke / slowloris.js
Last active December 15, 2017 21:01
Slowloris
var net = require('net');
var tls = require('tls');
var url = require('url');
var util = require('util');
var commander = require('commander');
commander.option('-u, --url [url]', 'Url to hit')
.option('-c, --connections [connections]', 'Connections to use simultaneously', 256, parseInt)
.option('-t, --timings [timings]', 'Which set of timings to use', 'default')
@ameliemaia
ameliemaia / three-examples-converter.js
Last active November 26, 2018 03:32
Convert threejs examples js to es6 - slightly hacky but works
var fs = require('fs');
require('shelljs/global');
const EXAMPLES_DIR = './node_modules/three/examples/js'
const DEST_DIR = './src/js/lib/three/examples'
mkdir('-p', DEST_DIR);
const files = [
`${EXAMPLES_DIR}/loaders/GLTFLoader.js`,
@eugene-babichenko
eugene-babichenko / CMakeLists.txt
Last active July 1, 2023 18:01
CMakeLists.txt and toolchain file for building STM32 HAL-based projects generated with STM32CubeMX with arm-none-eabi-gcc. STM32CubeMX settings. Toolchain: SW4STM32. ☑ Generate under root.
set(PRJ_NAME CLion_STM_LED)
set(MCU_FAMILY STM32F1xx)
set(MCU_LINE STM32F103xB)
set(MCU_LINKER_SCRIPT STM32F103RBTx_FLASH.ld)
cmake_minimum_required(VERSION 3.6)
project(${PRJ_NAME} C ASM)
add_definitions(-D${MCU_LINE})

Liposomal Vitamin-C

Tools

  • Scale
  • Blender
  • Ultrasound cleaning device
  • Spoon (wooden|plastic|glas)
  • Mason jar for storage
from socket import *
import time
import os,sys
cport=40002
red=bytes('\xFF\x00\x00')
blue=bytes('\x00\xFF\x00')
green=bytes('\x00\x00\xFF')
black=bytes('\x00\x00\x00')
@yrps
yrps / gs.sh
Last active November 13, 2017 17:46
Overlay image and text on a PDF with imagemagick and ghostscript
#!/bin/sh
set -eu
srcfile1="$1"
srcfile2="out.pdf"
out="${srcfile1%\.*}-signed.${srcfile1##*\.}"
gs -dBATCH -dNOPAUSE -dQUIET -sDEVICE=pdfwrite \
-dLastPage=1 -sOutputFile="$out" "$srcfile1" "$srcfile2"
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active April 13, 2024 16:19
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@adamgreig
adamgreig / 00-README.md
Last active August 12, 2022 08:37
Run embedded Rust code on your STM32F4

Embedded Rust on STM32F4

My notes from implementing Job Vranish's excellent guide.

Follow along with the guide above, getting rustc from rustup or similar:

rustc 1.0.0-nightly (dcaeb6aa2 2015-01-18 11:28:53 +0000)
binary: rustc
commit-hash: dcaeb6aa23ecba2dc2af870668a9239136d20fa3

commit-date: 2015-01-18 11:28:53 +0000

@maebert
maebert / latest_topic.txt
Last active August 29, 2018 04:30
Get notified when somebody posts a new topic in a forum
71750
@rdb
rdb / js_linux.py
Last active April 8, 2024 10:12
Access joysticks/game controllers from Python in Linux via the joystick driver. See https://discourse.panda3d.org/t/game-controllers-on-linux-without-pygame/14128
# Released by rdb under the Unlicense (unlicense.org)
# Based on information from:
# https://www.kernel.org/doc/Documentation/input/joystick-api.txt
import os, struct, array
from fcntl import ioctl
# Iterate over the joystick devices.
print('Available devices:')