Skip to content

Instantly share code, notes, and snippets.

@jpoehls
jpoehls / wrapper.bat
Last active July 8, 2024 21:06
Batch file wrapper for a PowerShell script. Wraps execution of a PowerShell script inside a Windows batch file.
@echo off
:: Execute the PS1 file with the same name as this batch file.
set filename=%~d0%~p0%~n0.ps1
if exist "%filename%" (
PowerShell.exe -NoProfile -NonInteractive -NoLogo -ExecutionPolicy Unrestricted -Command "& '%filename%'"
:: Collect the exit code from the PowerShell script.
set err=%errorlevel%
@revmischa
revmischa / wr703n-blink.c
Created January 7, 2012 22:53
TP-LINK WR703n LED Blinker
@davidruhmann
davidruhmann / carlos.bat
Last active May 6, 2023 23:32
[Batch] Pure Batch Color Routine by David Ruhmann based of DosTips' Carlos
@Echo Off
Call :Color A "######" \n E "" C " 21 " E "!" \n B "######" \n
Pause >Nul
Exit /B
:Color
:: v21
:: Arguments: hexColor text [\n] ...
:: \n -> newline ... -> repeat
:: Supported in windows XP, 7, 8.
@jameshfisher
jameshfisher / How to make a private Gist public.md
Created January 5, 2014 16:31
How to make a private Gist public

Github provides no facility to do this via the UI. This is sad, because it would be extremely useful in order to draft something before publishing it. It would also be trivial for them to implement. Never mind; here's how to do it manually:

  1. Get the "Clone this Gist" text from the left-hand side of the private Gist, e.g. https://gist.github.com/b9cc265982870c091a1e.git, and extract the ID b9cc265982870c091a1e.
  2. Go to https://gist.github.com/ and create a dummy new public Gist.
  3. Get the "Clone this Gist" text from the left-hand side, e.g. https://gist.github.com/8270253.git, and extract the ID 8270253.
  4. git clone git@gist.github.com:b9cc265982870c091a1e tmp-dir && cd tmp-dir && git push -f git@gist.github.com:8270253.git
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active July 14, 2024 15:27
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@shanecelis
shanecelis / CoroutineTests.cs
Last active July 15, 2022 15:03
I was curious about how one could manually drive Unity's coroutines without necessarily putting them into Unity's scheduler.
/*
CoroutineTests.cs -- Shane Celis
I was curious about how one could manually drive Unity's coroutines
without necessarily putting them into Unity's scheduler. At the
heart of it, it's really easy to manually drive them:
// Get the coroutine.
IEnumerator ienum = MyCoroutine();
// Run it until it yields.
@gboudreau
gboudreau / install-ffmpeg-amazon-linux.sh
Last active June 7, 2024 16:35
How to compile ffmpeg on Amazon Linux (EC2)
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@ejhayes
ejhayes / request_image_byte_range.js
Last active March 14, 2018 10:15
Request partial byte range of png using 206 partial content request
// PNG file structure
// taken from: http://www.w3.org/TR/REC-png-961001#Structure
var xhr = new XMLHttpRequest;
xhr.onreadystatechange = function () {
if (xhr.readyState != 4) {
return;
}
debugger;

Convert a MBR disk to GPT without losing any operating system data (Windows 7)

By Greg5884

Introduction

For the past week, I've been determined to triple boot with my existing Windows 7 installation, Ubuntu, and Mac OS X (Hackintosh). In order to do so on my laptop, I would have to change the partition table from MBR (Master Boot Record) to GPT (Guided Partition Table).

However, I did not want to lose my existing Windows 7 installation since I had a lot of files/applications already installed. Moreover, I've had a woeful track record of having my data botched during Windows backups.

Many of the how-to's covering this conversion typically say that you have to wipe the entire hard drive and reinstall, but after following a few different guides and doing enough tinkering around in Windows PE, I managed to retain my same Windows partition without any loss.

@stephenlb
stephenlb / animated-gif.md
Last active October 31, 2020 22:57
DIY How to make your own HD Animated GIF Generator

HD Animated GIF Generator

You can make your own HD animated GIF generator.
Follow along with these commands to get started.

HD Animated GIF Generator

git clone git://source.ffmpeg.org/ffmpeg.git
cd ffmpeg