Skip to content

Instantly share code, notes, and snippets.

@pebreo
pebreo / homepage-projects.jade
Created December 29, 2013 20:27
Homepage My Projects Bootstrap 2
!!! 5
html(lang='en')
head
meta(charset='utf-8')
title My Name
//if lt IE 9
script(src='http://html5shim.googlecode.com/svn/trunk/html5.js')
link(href='/static/landing/img/shyguy.ico', rel='shortcut icon')
link(href='/static/landing/css/bootstrap.min.css', rel='stylesheet')
link(href='/static/landing/css/custom-resume.css', rel='stylesheet')
@pebreo
pebreo / jquery-events-demo.html
Created December 15, 2013 04:28
jQuery Events Demo
<!-- BASIC JOUERY EVENT DEMO2 -->
<html>
<meta http-equiv="Content-Type" content="text/html"; charset="UTF-8" />
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<!--<script src="http://code.jquery.com/jquery-latest.js"></script> -->
@pebreo
pebreo / basic-css.html
Last active December 30, 2015 10:59
Very basic CSS
<html>
<head>
<style>
h1 {text:bold;}
#myid {color: green;}
footer p {color: red; text: bold;}
</style>
</head>
@pebreo
pebreo / basic-column-highcharts.html
Created December 1, 2013 21:34
jsFiddle for HighChart basic column
<!-- Use jQuery 1.9.1 -->
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
<!-- javascript -->
$(function () {
var chart = {
@pebreo
pebreo / django-jquery-demo.py
Last active April 29, 2020 05:15
jQuery AJAX + Django SIMPLE DEMO
# views.py - django app called ajx
from django.shortcuts import render, get_object_or_404, redirect, HttpResponse, render_to_response, HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.contrib.auth import authenticate, login
import json
def mygetview(request):
if request.method == 'GET':
@pebreo
pebreo / jquery-html-skeleton.html
Last active December 29, 2015 21:09
jQuery + HTML skeleton
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script type="text/javascript">
$(function() {
$('#mybutton').click(function() {
});
@pebreo
pebreo / uibtre.py
Last active December 27, 2015 19:59
Remote Tank Control using Android SL4A + Bluetooth
# Video of the code in action: http://www.youtube.com/watch?v=BtmRBxRsMk4
#! python
# -= encoding=utf-8 =-
##############################################################################
#
# uibtre.py $Rev:$
# $Id$
#
# Copyright (c) 2011, shimoda as kuri65536 _dot_ hot mail _dot_ com
# ( email address: convert _dot_ to . and joint string )
@pebreo
pebreo / excel_py_tokenize.py
Created October 19, 2013 05:08
Tokenize Excel formula
#========================================================================
# Description: Tokenise an Excel formula using an implementation of
# E. W. Bachtal's algorithm, found here:
#
# http://ewbi.blogs.com/develops/2004/12/excel_formula_p.html
#
# Tested with Python v2.5 (win32)
# Author: Robin Macharg
# Copyright: Algorithm (c) E. W. Bachtal, this implementation (c) R. Macharg
#
@pebreo
pebreo / planets-wander.coffee
Created October 12, 2013 00:20
Why Planets Wander (in Coffescript via js2coffee.org) original source: Khan Academy: https://www.khanacademy.org/cs/spin-off-of-why-planets-wander/2207805122
#
# * Simulation of telescope on Earth looking at the night
# * sky (ignoring the rotation of the Earth).
# *
# * Telescope angles relative to vernal equinox (First Point of Aries).
# *
# * - Planets -
# * Green: Mercury
# * Gray: Venus
# * Brown: Mars
@pebreo
pebreo / chess.coffee
Last active December 25, 2015 03:49
Coffeescript Chess (via KhanAcademy) https://www.khanacademy.org/cs/new-program/2193445389
#Thanks for all the votes, I never expected that much, just 1 or 2.
noCursor()
frameRate 20000000000000000000000000000
colors = []
board = [2000000000000000, " RNBQKBNR", " PPPPPPPP", " ........", " ........", " ........", " ........", " PPPPPPPP", " RNBQKBNR"]
sides = [0, " bbbbbbbb", " bbbbbbbb", " ........", " ........", " ........", " ........", " wwwwwwww", " wwwwwwww"]
possibleMoves = [0, " 00000000", " 00000000", " 00000000", " 00000000", " 00000000", " 00000000", " 00000000", " 00000000"]
#var board = [0,
#" RNBQKBNR",