Skip to content

Instantly share code, notes, and snippets.

View eligundry's full-sized avatar
🧥
3 junior developers stacked upon each other in a trench coat

Eli Gundry eligundry

🧥
3 junior developers stacked upon each other in a trench coat
View GitHub Profile
@eligundry
eligundry / insanity-wolf-debugging.js
Created November 18, 2014 17:43
Shouldn't work, but fuck it.
try {
// something stupid
} catch (e) {
alert("YOU DONE FUCKED UP! " + e.message + "! TERMINATING!");
window.close();
}
@eligundry
eligundry / dmesg
Created January 2, 2015 20:05
wireless_issue
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 3.18.1-1-MANJARO (builduser@phil) (gcc version 4.9.2 (GCC) ) #1 SMP PREEMPT Thu Dec 18 03:38:20 UTC 2014
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-318-x86_64 root=UUID=94480cf3-56f6-483e-bc2a-5719acbc6216 rw quiet splash
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009e7ff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009e800-0x000000000009ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000000d2000-0x00000000000d3fff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000000dc000-0x00000000000fffff] reserved
### Keybase proof
I hereby claim:
* I am eligundry on github.
* I am eligundry (https://keybase.io/eligundry) on keybase.
* I have a public key whose fingerprint is E537 5EBD 4507 36F2 358A 1619 ACC1 4C81 E28C A7AD
To claim this, I am signing this object:
@eligundry
eligundry / gist:e6b0c35519dc13813547
Created August 4, 2015 15:59
debian flipping out
╭─[~/Code/Croscon/bestday/application] [:develop*:e1865cb]
╰⤭ apt-cache policy dropbox [11:58]
\dropbox:
Installed: 2015.02.12
Candidate: 2015.02.12
Version table:
*** 2015.02.12 0
500 http://linux.dropbox.com/debian/ sid/main amd64 Packages
500 http://linux.dropbox.com/debian/ sid/main i386 Packages
100 /var/lib/dpkg/status
#include <iostream>
using namespace std;
/*
* Basically, this code right here will swap the
* values of two variables. I was able to do it
* in one line, which my professor said should be
* impossible.
*/
@eligundry
eligundry / lottery.cpp
Created March 2, 2012 21:12
Lottery Lap
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
void initalize(int array[], int size, int val);
int check(int array[], int size, int val);
void draw(int array[], int size);
void entry(int& guess);
#include "battleship.h"
int main()
{
ship battleships[FLEET_SIZE];
location target;
deploy(battleships);
printFleet(battleships);
@eligundry
eligundry / alternate.html
Created June 13, 2012 19:49
Better way of attaching event listeners
<ul>
<li id="item-1">Item 1</li>
<li id="item-2">Item 2</li>
<li id="item-3">Item 3</li>
</ul>
<script type="text/javascript">
$('ul').on('click', 'li', function(e) {
alert( "You clicked " + $(this).text() );
});
@eligundry
eligundry / sample.py
Last active December 1, 2015 21:54
Python Correctly Trim Decimals
import decimal
def trim_decimal(value):
if isinstance(value, (decimal.Decimal, float)):
# I think format was something Django specific, because I don't know where it came from or what it does.
value = format(value, 'f')
s = str(value)
return s.rstrip('0').rstrip('.') if '.' in s else s
@eligundry
eligundry / c.cpp
Created October 15, 2013 01:37 — forked from anonymous/c.cpp
/*
* =====================================================================================
*
* Filename: c.cpp
*
* Description: Our attempt at the 'Give me an E' problem
*
* Version: 1.0
* Created: 10/14/2013 06:14:39 PM
* Revision: none