Skip to content

Instantly share code, notes, and snippets.

View lad1337's full-sized avatar
🤔
💡

Dennis Lutter lad1337

🤔
💡
View GitHub Profile
@acarril
acarril / bootable-win-on-mac.md
Created November 18, 2022 17:49
Create a bootable Windows USB using macOS

For some reason, it is surprisingly hard to create a bootable Windows USB using macOS. These are my steps for doing so, which have worked for me in macOS Monterey (12.6.1) for Windows 10 and 11. After following these steps, you should have a bootable Windows USB drive.

1. Download a Windows disc image (i.e. ISO file)

You can download Windows 10 or Windows 11 directly from Microsoft.

2. Identify your USB drive

After plugging the drive to your machine, identify the name of the USB device using diskutil list, which should return an output like the one below. In my case, the correct disk name is disk2.

@mdomke
mdomke / globimport.py
Last active April 4, 2018 15:25
Python glob import
import importlib
import pkgutil
def globimport(pattern):
base, found, rest = pattern.partition('*')
try:
module = importlib.import_module(base.rstrip('.'))
except ImportError:
pass
@ItKindaWorks
ItKindaWorks / dashMQTT.ino
Last active December 17, 2022 02:13
Small ESP8266 program that sends a message over MQTT and then goes into deep sleep until woken up again.
/*
dashMQTT.ino
Copyright (c) 2017 ItKindaWorks All right reserved.
github.com/ItKindaWorks
dashMQTT.ino is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@boredzo
boredzo / colorman.zsh
Last active June 19, 2017 14:44 — forked from cocoalabs/gist:2fb7dc2199b0d4bf160364b8e557eb66
Color Terminal for bash/zsh etc..
man() {
env \
LESS_TERMCAP_md=$'\e[1;36m' \
LESS_TERMCAP_me=$'\e[0m' \
LESS_TERMCAP_se=$'\e[0m' \
LESS_TERMCAP_so=$'\e[1;40;92m' \
LESS_TERMCAP_ue=$'\e[0m' \
LESS_TERMCAP_us=$'\e[1;32m' \
man "$@"
}
anonymous
anonymous / prompt_jemhuntr_setup
Created January 29, 2016 11:20
#
# A ZSH theme inspired by paradox and agnoster themes,
# supercharged with FontAwesome icons.
#
# This theme requires a patched Powerline font. You will also need to
# have FontAwesome set as default fallback font.
#
# Authors:
# Jerome Indefenzo <jeromeindefenzo@gmail.com>
@DarinM223
DarinM223 / Concepts.md
Last active May 20, 2024 02:36
Rust concept explanations

My explanation of the main concepts in Rust

There are three main concepts with Rust:

  1. Ownership (only one variable "owns" the data at one time, and the owner is in charge of deallocating)
  2. Borrowing (you can borrow a reference to an owned variable)
  3. Lifetimes (all data keeps track of when it will be destroyed)

These are fairly simple concepts, but they are often counter-intuitive to concepts in other languages, so I wanted to give a shot at

@fmasanori
fmasanori / jogos.py
Last active October 30, 2022 00:00
World Cup in six lines of Python 3. Jogos da Copa do Mundo em cinco linhas de Python 3.
import requests
jogos = requests.get('http://worldcup.sfg.io/matches').json()
for jogo in jogos:
if jogo['status'] in ('completed', 'in progress'):
print (jogo['home_team']['country'], jogo['home_team']['goals'], 'x',
jogo['away_team']['country'], jogo['away_team']['goals'])
@mabdrabo
mabdrabo / sound_recorder.py
Created January 28, 2014 23:05
Simple script to record sound from the microphone, dependencies: easy_install pyaudio
import pyaudio
import wave
FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 44100
CHUNK = 1024
RECORD_SECONDS = 5
WAVE_OUTPUT_FILENAME = "file.wav"
@willurd
willurd / web-servers.md
Last active May 24, 2024 13:07
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@vitorgalvao
vitorgalvao / Get Title and URL.applescript
Last active May 22, 2024 11:01
AppleScript and JavaScript for Automation to get frontmost tab’s url and title of various browsers.
-- AppleScript --
-- This example is meant as a simple starting point to show how to get the information in the simplest available way.
-- Keep in mind that when asking for a `return` after another, only the first one will be output.
-- This method is as good as its JXA counterpart.
-- Webkit variants include "Safari", "Webkit", "Orion".
-- Specific editions are valid, including "Safari Technology Preview".
-- "Safari" Example:
tell application "Safari" to return name of front document