Skip to content

Instantly share code, notes, and snippets.

View fernandozamoraj's full-sized avatar

Fernando Zamora fernandozamoraj

View GitHub Profile
@fernandozamoraj
fernandozamoraj / jumpingavatar
Created March 12, 2015 03:36
jump simple game
function Avatar(scene){
var JUMP_FORCE = 14;
var sprite = new Sprite(scene, "./img/image.png", 150, 150);
var jumping = false;
sprite.init = function(){
this.setSpeed(0);
};
@fernandozamoraj
fernandozamoraj / getlinks
Last active September 13, 2015 21:21
get links from a url
import httplib2
import webbrowser
import random
from BeautifulSoup import BeautifulSoup, SoupStrainer
#########################################################
#
# Extract all the hyperlinks from the given URL
#
#########################################################
import sys
import _winreg
#this checker only works on a windows box... i tested it on my windows 7 64bit box
#this script displays the history of your wifi connections... or better said
#all the wifi connections that you have previously used
def val2addr(val):
addr = ''
for ch in val:
# coding: utf-8
from random import randint
class Card:
suit_strings = ['','D', 'H', 'C', 'S']
face_strings = ['', 'A', '2', '3', '4', '5', '6', '7', 'J', 'Q', 'K']
def __init__(self, face, suit):
self.face = face
self.suit = suit
# coding: utf-8
class Node:
def __init__(self, data, parent):
self.left = None
self.data = data
self.right = None
self.parent = parent
def __repr__(self):
n = 'Node: '
@fernandozamoraj
fernandozamoraj / program1.pde
Created January 26, 2017 06:38
A binary search tree using processing language
/*
Author: Fernando Zamora
Description:
In this program I will attempt to draw out a binary search tree from 16 random values
*/
@fernandozamoraj
fernandozamoraj / binarytree.pde
Created January 27, 2017 03:16
Creates a binary tree and draws it using Processing.
/*
Author: Fernando Zamora
Description:
In this program I will attempt to draw out a binary search tree from N random values
*/
int currentIndex = 0;
@fernandozamoraj
fernandozamoraj / monitor_ip_change.py
Last active March 31, 2017 04:46
This script can be used to help you monitor your box's IP. That way you always know what IP to remote into.
import socket
import smtplib
import sys
from time import sleep
from email.mime.text import MIMEText
FILE_NAME = '/dev/last_known_ip.dat'
TIME_INTERVAL = 600 #600 = 10 minutes
@fernandozamoraj
fernandozamoraj / Js not working
Last active April 16, 2017 19:31
Js is it working and I don't know why
console.log(this);
(function(g, $) {
function MyRealLib(){
return function(s){
console.log(s);
};
}