Skip to content

Instantly share code, notes, and snippets.

View jesuscast's full-sized avatar

Andres Castaneda jesuscast

View GitHub Profile
import numpy as np
x = np.array([0.0,1.0,2.0])
y = np.array([0.0,0.8,0.9])
z = np.polyfit(x,y,3)
p = np.poly1d(z)
y2 = [ p(N) for N in x ]
print str(y2[0])
How to run cordova on linux for my specific computer only.
This is only a memo for myself.
First of all using user jesus:
go to
cd ~/Android/Sdk/tools
./android avd
and let that run
URL:
http://3c25fbaf.ngrok.io/
Screens in order:
Index:
http://3c25fbaf.ngrok.io/index.html
Login:
/*
?>
<!-- Slider
================================================== -->
<div class="slider-wrapper">
<?php
if ( is_active_sidebar( 'he-main-slider' ) ) {
?>
<div class="menu-top-wrapper">
<video autoplay="" loop="" poster="img/cover-background.png" id="bgvid" class="stretchToFit" style="">
<source src="http://executive.inncubator.net/wp-content/uploads/2015/10/video21.mp4" type="video/mp4">
<source src="http://executive.inncubator.net/wp-content/uploads/2015/10/video2.webm" type="video/webm">
</video>
<img class="ls-l ls-preloaded" id="image-in-header" style="top: 266.5px; left: 680.5px; white-space: nowrap; width: 479px; height: 67px; padding: 0px; border-width: 0px; visibility: visible; margin-left: 0px; margin-top: 0px; transform-origin: 50% 50% 0px; transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -0.002, 0, 0, 0, 1); opacity: 1;" data-ls="offsetxin:0;durationin:2500;offsetxout:0;" src="http://www.inncubator.net/wp-content/uploads/2015/04/tag.png" data-src="http://www.inncubator.net/wp-content/uploads/2015/04/tag.png" alt="">
<p id="button-in-header" class="ls-l" style="top: 369px; left: 825px; white-
@jesuscast
jesuscast / obtain_match.js
Last active November 7, 2015 00:07
Algorithm to match two lawyers in the Youth in Government application
var obtainMatch = function() {};
$(document).ready(function(){
// List of all judges. Make sure those specific strings are used when assigning judges to
// the users
judgesWhoPresideFB = ["judge 1", "judge 2", "judge 3"];
// List of all judges. Make sure those specific strings are used when assigning judges to
// the users
judgesWhoScoreFB = ["judge 1", "judge 2", "judge 3"];
@jesuscast
jesuscast / examples.py
Last active November 22, 2015 20:34
Really good examples of exposing class decorators. Taken from bottle.py Nothing here makes sense it is just for me to remember how to write some code.
+route = functools.wraps(Bottle.route)(lambda *a, **ka: app().route(*a, **ka))
+get = functools.wraps(Bottle.get)(lambda *a, **ka: app().get(*a, **ka))
+post = functools.wraps(Bottle.post)(lambda *a, **ka: app().post(*a, **ka))
+put = functools.wraps(Bottle.put)(lambda *a, **ka: app().put(*a, **ka))
+delete = functools.wraps(Bottle.delete)(lambda *a, **ka: app().delete(*a, **ka))
+error = functools.wraps(Bottle.error)(lambda code: app().error(code))
def route(self, path=None, method='GET', **kargs):
""" Decorator: Bind a function to a GET request path.
@jesuscast
jesuscast / permutations_exhaustive.py
Last active November 27, 2015 00:45
Exhaustive search algorithm that given a list of numbers L tries to find the set M of L with the least cardinality (lowest number of elements) that when added together the result lies within a percent error C of a goal number G, according to the following inequality: (C-1)*G < Sigma(M) < (C+1)*G
def r(m, g, l, d, u, j):
# print "r iteration: "+str(d)
if d == len(l)+10:
return False
mS = sum(m)
mL = len(m)
if mS == g:
return m
if mS < g*(1.0+j) and mS > g*(1.0-j):
return m
@jesuscast
jesuscast / lol.js
Created December 3, 2015 23:28
hides deleted ads from your craigslist account.
$(".status").each(function(index, element) { if($(element).html().indexOf("Deleted") != -1 ) { $(element).parent().hide(); }; });
@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)