Skip to content

Instantly share code, notes, and snippets.

View mcd1992's full-sized avatar
🦀
How2Rust?

Aaron mcd1992

🦀
How2Rust?
View GitHub Profile
@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active June 16, 2024 09:00
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

Slider

You've probably seen the slider in the options GUI a lot. But what you might not know is that you can't use it directly in your GUI if you so wished. The slider is hardcoded to work with the options GUI and to be able to use it, we have to make our own slider.

The easiest way to do this is to copy the contents of GuiSlider and pasting it into a new class which can be called GuiSliderFixed for example. After you've pasted the code, the first thing you need to do is change the class name and constructor name from GuiSlider to GuiSliderFixed.

After you're done with that, we can go over what's making the slider un-usable in the first place. The constructor has a parameter called EnumOptions par4EnumOptions. This parameter decides which option the slider is going to modify, and if left to null, it will cause a NullPointerException, since further down in the code the parameter is being used. To fix this, we need to remove all references to EnumOptions in the class. After you're done with that the sl

@aras-p
aras-p / preprocessor_fun.h
Last active June 12, 2024 00:35
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@dconnolly
dconnolly / README.md
Last active June 7, 2024 07:42
All 100 Chromecast background images that are rotated through, linked to their original locations on Google hosting. Links to 2560 width versions, where available.
@t-mat
t-mat / hammerwatch-assets-bin-unpacker.ps1
Created January 4, 2014 18:24
Hammer Watch assets.bin unpacker
<# /*
unpack 'C:\Program Files (x86)\Steam\steamapps\common\Hammerwatch\assets.bin'
+0 int8[4] 'HWRA' 0x48, 0x57, 0x52, 0x41
+4 int32 number of files
+8 file #0
file
+0 int8 filename_len
@TobiasWooldridge
TobiasWooldridge / gist:22f0cdca75190b9a473f
Last active June 11, 2024 17:30
How to Unbrick a Kindle Paperwhite

How to unbrick an Amazon Kindle Paperwhite™

This guide instructs you in how to unbrick an Amazon Kindle Paperwhite. The consequences of following it are your own responsibility. This method (opening the Kindle and using the serial interface) should be a last resort and should only be considered if other methods fail

The Guide

  1. Pry open Kindle using a prying tool
  2. Unscrew the screen and remove it from the base. Note that there's a screw hidden under the adhesive at the top in the middle
  3. Solder tin wire to serial ports on the bottom
  4. Attach tin wire to USB TTY device (order is ground, RX, TX, from the kindle's perspective, where GND is the smallest pad) and plug USB TTY device into your computer
  5. Open Putty on your computer in serial mode, with the serial port specified as your USB device and baud configured to 115200
@bsmartt13
bsmartt13 / gist:efa02c40ea12c09d9c3a
Created September 17, 2014 17:02
OTX IP Reputation download links (updated hourly)
https://reputation.alienvault.com/reputation.generic.gz
https://reputation.alienvault.com/reputation.generic
https://reputation.alienvault.com/reputation.data
https://reputation.alienvault.com/reputation.snort.gz
https://reputation.alienvault.com/reputation.snort
https://reputation.alienvault.com/reputation.iptables.gz
https://reputation.alienvault.com/reputation.iptables
https://reputation.alienvault.com/reputation.squid.gz
https://reputation.alienvault.com/reputation.squid
https://reputation.alienvault.com/reputation.unix.gz
@eestrada
eestrada / cookie_converter.py
Last active May 2, 2022 21:17
simple script to convert google chrome sqlite cookie entries to old netscape cookies.txt format. Original code from here: https://productforums.google.com/d/msg/chrome/LWvfAFolOW4/hrC8ssNr27YJ
#ifndef NOISE_SIMPLEX_FUNC
#define NOISE_SIMPLEX_FUNC
/*
Description:
Array- and textureless CgFx/HLSL 2D, 3D and 4D simplex noise functions.
a.k.a. simplified and optimized Perlin noise.
The functions have very good performance
and no dependencies on external data.
@mentlerd
mentlerd / sh_grep.lua
Created January 28, 2015 12:10
Pretty printing for gmod13
-- Global 'nil' value
NIL = {}
-- Localise for faster access
local pcall = pcall
local string_len = string.len
local string_sub = string.sub
local string_find = string.find