Skip to content

Instantly share code, notes, and snippets.

View jesuscast's full-sized avatar

Andres Castaneda jesuscast

View GitHub Profile
@jessejanderson
jessejanderson / the_abcs_of_otp.md
Last active March 13, 2024 11:23
The ABCs of OTP
@jesuscast
jesuscast / polynomialdivision.php
Last active August 29, 2015 14:02
Calculates de division of two polynomials. ENTRY an array where the index i equals the term with degree i. EX array(1,4,3) = 3x^2+4x+1
<?php
function degree($polynomial){
for($i = (count($polynomial)-1); $i>=0; $i--){
if($polynomial[$i]!=0){
return $i;
}
}
return 0;
}
function formatPolynomial($poly){
@jesuscast
jesuscast / rmAll.py
Last active December 20, 2015 00:19
Removes all of the deleted files in git if there is any modified neither new files on stage
import subprocess
import re
def rmAll():
output = subprocess.check_output("git status", shell=True)
matches = re.findall('deleted: .*', output)
for n in matches:
clean = n.replace("deleted: ","")
subprocess.call("git rm "+clean, shell=True)
@jakeonrails
jakeonrails / Ruby Notepad Bookmarklet
Created January 29, 2013 18:08
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>