Skip to content

Instantly share code, notes, and snippets.

View ejmg's full-sized avatar
💾

ejmg ejmg

💾
View GitHub Profile
@ejmg
ejmg / gist:bc8d8bb629e9bb82561504683ddacc9b
Created October 25, 2016 10:21 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@ejmg
ejmg / UTC_Timezone_Codes.py
Created November 2, 2016 06:29
Dictionary with UTC offset values mapped to their phonetic codes
timezones = {"-12:00": "Y",
"-11:00": "X",
"-10:00": "W",
"-09:00": "V",
"-08:00": "U",
"-07:00": "T",
"-06:00": "S",
"-05:00": "R",
"-04:00": "Q",
"-03:00": "P",
@ejmg
ejmg / PrettyPrint2DArray.py
Created November 3, 2016 01:48
Print the contents of a square 2d array as a nicely formatted string
# Prints a square 2d array nicely with spacing of elements
# Modify frmt for the number of elements in each row, as well as the matrix itself of course
newline, empty, frmt = "\n", "", "{:4}"
print(newline.join([empty.join([frmt.format(element) for element in row])
for row in matrix]))
@ejmg
ejmg / getContinousInput.py
Created November 3, 2016 06:17
get an unknown number of lines of input
try:
while True:
inp = input()
if inp != "":
# code
else:
break
except EOFError:
pass
@ejmg
ejmg / ubuntu_py3.md
Created December 26, 2016 20:06 — forked from softwaredoug/ubuntu_py3.md
Ubuntu 14.04 Python 3.4.2 Setup using pyenv and pyvenv

What I did to get Python 3.4.2 on Ubuntu 14.04. The stock version of Python 3 on Ubuntu is 3.4.0. Which is missing some of the best parts! (asyncio, etc). Luckily I discovered pyenv which solved my problem.

Install pyenv

Pyenv (not to be confused with pyvenv) is the Python equivelant of rbenv. It lets you configure which Python environment/version is available per directory, user, or other session variables.

I followed the instructions here to install pyenv in my home directory. Verbatem, those instructions are:

sudo apt-get install git python-pip make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev
@ejmg
ejmg / org-to-latex-to-pdf.org
Last active January 22, 2017 23:18
This is a template for making a well formatted/tweaked org file that you can export to pdf via latex. It overrides the default headings and footers using the fancyhdr package. I included other customizations I'd use, like biblatex-chicago, but that's up to you. How Gist displays this file is obviously not how it will look once exported via org-m…

@@latex: \Large Here’s how to break a large title@@

\newpage

Keybase proof

I hereby claim:

  • I am ejmg on github.
  • I am ejmg (https://keybase.io/ejmg) on keybase.
  • I have a public key ASCoBbTOgBbATFzQQ5kkAn7dw45Ufp-Xp5SLJBAclFvUOQo

To claim this, I am signing this object:

Verifying that "eliasjmgarcia.id" is my Blockstack ID. https://onename.com/eliasjmgarcia
@ejmg
ejmg / he-warned-every-single-one-of-us.txt
Created November 1, 2017 13:27
html placeholder friendly version of Baudrillard's seminal non-fiction work of how we all will achieve utopian happiness via technology
"Everything begain with objects, yet there is no longer a system of objects. The critique of objects was based on signs saturated with meaning, along with their phantasies and unconscious logic as well as their prestigious differential logic. Behind this dual logic lies the anthropological dream: the dream of the object as existing beyond and above exchange and use, above and beyond equivalence; the dream of a sacrificial logic, of gift, expenditure, potlatch, &quotdevil's share&quot consumption, symbolic exchange.1
All this still exists, and simultaneously it is disappearing. The description of this projective imaginary and symbolic universe was still the one of the obect as the mirror of the subject. The opposition of the subject and the object was still significant, as was the profound imaginary of the mirror and the scene.2 The scene of history as well as the scene of the everyday emerge in the shadow of history as it is progressively divested of po
@ejmg
ejmg / R-Wiki.md
Last active March 11, 2018 01:48
My wiki submission for CS441: Programming Languages