Skip to content

Instantly share code, notes, and snippets.

@mackankowski
mackankowski / # How to create a bootable Windows 7, 8 ,10, 11 installer USB on MacOS - readme.md
Last active May 3, 2024 06:51
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.

@tvst
tvst / streamlit_app.py
Last active May 3, 2024 06:39
Simple way to run heavy computations without slowing down other Streamlit users
import streamlit as st
import concurrent.futures # We'll do computations in separate processes!
import mymodule # This is where you'll do the computation
# Your st calls must go inside this IF block.
if __name__ == '__main__':
st.write("Starting a long computation on another process")
# Pick max number of concurrent processes. Depends on how heavy your computation is, and how
# powerful your machine is.
@henfiber
henfiber / KB-Buying-guide-EU.md
Last active May 3, 2024 06:38
Buying keyboards and keyboard components from EU

Europe

  • SkinFlint : Price comparison site which has some nice filtering options per switch type etc. Searches for offers in UK, Germany, Poland and Austria
  • mykeyboard.eu : Keyboards, keycaps and accessories. Based in Belgium.
  • candykeys.com : European Store selling Vortex, Leopold, KBP, Anne Pro keyboards, keycap sets and components (ISO + ANSI). Based in Germany, ships to EU.
  • falba.tech : custom wooden bamboo cases, and some acrylic and carbon ones. Switch packs (65 browns at 48EUR). Other parts for the GH60, Atreus, ErgoDox. Also Microcontrollers, diodes, leds etc.
  • 42keebs.eu - Mostly PCBs, tools and accessories. Located in Czech Republic.
  • KEYGEM : Switches, Keycaps, lubes, cables, DIY kits and deskmats. Based in Germany, ships to the EU and worldwide.
  • [Eloquent Clicks - Custom Mechanical Keyboard Store](https://www.eloquen
@michaelbutler
michaelbutler / Steam_Proton_Exe.md
Last active May 3, 2024 06:35
How to run another .exe in an existing proton wine prefix

Running games through Steam's Proton is great. But what if there is a secondary exe or configuration application bundled with the game? How can you launch it if Steam itself only launches the game?

Simply run this command in a terminal:

cd /path/to/steam/steamapps/compatdata/20920/pfx

STEAM_COMPAT_DATA_PATH="/path/to/steam/steamapps/compatdata/20920" WINEPREFIX=$PWD \
    "$HOME/.steam/root/steamapps/common/Proton 5.0/proton" run ./drive_c/path/to/custom_application.exe
@TUSF
TUSF / Valbli Orthography.md
Last active May 3, 2024 06:34
A draft for a block writing system, designed for Lojban.

https://tusf.page/valbli

(Note: This is a draft, and subject to change.)

Many writing systems have been proposed for Lojban. Hangul is the writing system used in Korean, and potentially a great option to use for Lojban. It's a featural writing system, meaning that most of its symbols are chosen for a reason, and not just arbitrarily. The most attractive feature of Hangul is the syllable-blocks that well compress the language.