Skip to content

Instantly share code, notes, and snippets.

View cesquivias's full-sized avatar

Cristian Esquivias cesquivias

  • Los Angeles, CA
View GitHub Profile
@cesquivias
cesquivias / py2018.html
Last active March 15, 2018 16:58
Happy π Day 2018
<!DOCTYPE html>
<html>
<head>
<title>Happy &pi; Day 2018</title>
</head>
<body>
<header>
<div>Total pins = <span id="total-pins"></span></div>
<div>Crossing pins = <span id="cross-pins"></span></div>
@cesquivias
cesquivias / hxl
Last active May 7, 2017 06:27
A simple binary compiler. Converts hexadecimal digits into a binary file. Supports comments
#!/usr/bin/env python
import os.path
import struct
def compile_line(line, i):
no_comment = line.split('#', 1)[0]
hex_code = no_comment.strip().replace(' ', '')
if len(hex_code) % 2 != 0:
raise Exception("%d: hex characters must be in pairs\n%s" % (i, line))
@cesquivias
cesquivias / pi2017.c
Created March 14, 2017 19:54
Happy PI Day 2017
/*
* Happy PI Day '17
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
const int COUNT = 1000000;