Skip to content

Instantly share code, notes, and snippets.

@mondain
mondain / public-stun-list.txt
Last active May 3, 2024 06:59
Public STUN server list
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478
@allenhumphreys
allenhumphreys / CreateCroppedPixelBufferBiPlanar.c
Last active May 3, 2024 06:58
Functions in Swift/C to Crop and Scale CVPixelBuffers in the BiPlanar formats
CVPixelBufferRef createCroppedPixelBufferBiPlanar(CVPixelBufferRef srcPixelBuffer, CGRect croppingRect, CGSize scaleSize) {
OSType inputPixelFormat = CVPixelBufferGetPixelFormatType(srcPixelBuffer);
assert(inputPixelFormat == kCVPixelFormatType_420YpCbCr8BiPlanarFullRange
|| inputPixelFormat == kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange);
size_t inputWidth = CVPixelBufferGetWidth(srcPixelBuffer);
size_t inputHeight = CVPixelBufferGetHeight(srcPixelBuffer);
assert(CGRectGetMinX(croppingRect) >= 0);
@zuyu
zuyu / ubuntu-install-gcc-6
Last active May 3, 2024 06:57
Install gcc 6 on Ubuntu
sudo apt update && \
sudo apt install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
sudo apt update && \
sudo apt install gcc-6 g++-6 -y && \
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6 && \
gcc -v
@Yengas
Yengas / README.md
Last active May 3, 2024 06:56
Creating Table of Contents by reading the folder and file structure of a git project

toc.py

This script reads the structure of your git project to create a markdown table of contents. You can use the output of this script to add a TOC to the README of your project.

Example folder structure:

.
├── Test
│   └── README.md
├── Test2
│   ├── README.md
@mackankowski
mackankowski / # How to create a bootable Windows 7, 8 ,10, 11 installer USB on MacOS - readme.md
Last active May 3, 2024 06:58
How to create a bootable Windows 7, 8, 10, 11 installer USB on macOS

How to create a bootable Windows 7, 8, 10, 11 installer USB on macOS

Run in Terminal:

  1. brew install wimlib - run, if wimlib is not installed yet (required for splitting large files)
  2. To identify target USB device, run: diskutil list
  3. Format USB drive: diskutil eraseDisk MS-DOS "$WIN_USB_NAME" MBR /dev/$DISK where $WIN_USB_NAME is a new volume name (e.g. WIN) and $DISK is a target disk identificator (e.g. disk5). Alternatively, you can try GTP partititon style instead of MBR (recommended for UEFI = newer Windows distributions)
  4. To mount Windows installer image, run: hdiutil mount ~/Desktop/$WIN_INSTALLER_IMAGE.iso where $WIN_INSTALLER_IMAGE is installer image name.
  5. Copy all files to the USB drive, beside the "install" file (if it's over 4GB size): rsync -vha --exclude=sources/install.$EXT /Volumes/$WIN_INSTALLER_NAME/ /Volumes/$WIN_USB_NAME where $EXT is wim or esd, $WIN_INSTALLER_NAME is the mounted Windows installer volume name and $WIN_USB_NAME is target disk name.
@FusionPizza
FusionPizza / Impact3D.js
Created October 29, 2012 14:20 — forked from chribbe/Impact3D.js
Helper to handle three.js objects to render an impactJS game
impact3D = {};
impact3D.models = impact3D.models || {};
impact3D.entities = impact3D.entities || {};
impact3D.player = impact3D.player || {};
impact3D.scene = null;
impact3D.updateCount = 0;
impact3D.init = function(scene)
{
console.log(" ***impact3D Init *** ");
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active May 3, 2024 06:43
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@ikusalic
ikusalic / notes_on_testing.md
Created October 24, 2013 21:12
Exploration: how to do unit testing

Testing notes

Uncle Bob: Test First

Source: http://blog.8thlight.com/uncle-bob/2013/09/23/Test-first.html

  • tests are specs for the system and are more important than the system itself
  • (Tests should be) short, well factored, and well named. They ought to read like specifications; because they are specifications
  • (Goal:) trust your test suite to the extent that, if it passes, you know you
#!/bin/sh
echo "Atualiza pacotes"
apt -y update
echo "Instalar [WGET]"
apt install wget -y
echo "Download Nessus"
@loilo
loilo / portfinder.md
Last active May 3, 2024 06:41
Find Free Port with PHP

Find Free Port with PHP

This is a quick way to find a random free port on a system using PHP:

$port = find_free_port();

Benchmarked locally, where finding a port always took around 0.15ms.