Skip to content

Instantly share code, notes, and snippets.

@pebreo
pebreo / math-patterns.md
Last active May 31, 2017 15:52
Math Patterns

Math Links

Attitude

Math is like riding a bicycle. The best way to learn is to get on the bicycle and start peddling. You may fall but ultimately each fall means you are getting better and better.

Word Problems

@pebreo
pebreo / js-snippets.md
Last active July 28, 2016 17:40
Javascript Snippets

Using reduce without lodash

a = [1,2,3];
var y = a.reduce(function(sum, n){
	return sum + n;
}, 0);

console.log(y);

Hive

Goal: Surround your opponent's Bee completely (either color).

Setup: Each player should have:
* 1 Bee
* 3 Ants
@pebreo
pebreo / driver.md
Last active December 23, 2020 10:52
Arduino motor driver control
#PyBoard
# screen /dev/tty.usbmodem*

# Servo Example 
# http://docs.micropython.org/en/latest/pyboard/tutorial/servo.html
import pyb
s1 = pyb.Servo(1) # pin X1
s1.angle(45)
@pebreo
pebreo / excel.md
Created December 8, 2015 06:41
Excel shortcuts

Shortcuts

Fill handle - double click to autofill the formula values for blank rows of a tables
F3 - paste list
F4 - cycle through cell reference type (absolute, relative, mixed)
CTRL-T - create table
CTRL-A - open function dialog
CTRL-Z- undo 
@pebreo
pebreo / writing-bootstrap.md
Last active May 3, 2018 15:33
Writing patterns

Writing patterns

Sentence openers/Dressing up sentences

1. Subject opener. 

The dog chased the cat.t
@pebreo
pebreo / cheatsheet.md
Last active August 29, 2015 14:23
DjangoGirls Chicago Notes

DjangoGirls Tutorial Notes

Below are some notes taken from the DjangoGirls Chicago workshop.

Linux/MacOS-specific Commands

Command(Apple)+Space and search for Terminal

cd mydir # change directory
@pebreo
pebreo / html-bootstrap.md
Last active August 29, 2015 14:22
Bootstrap3 + HTML

Overview

  • div and spans are grouping tags

  • class tags are mostly used for assigning styling to a div

  • class assigniments to an element are additive e.g. `class = 'class1 class2'``

  • the class definition in CSS file/block that's more bottom takes precedence over the one on top, e.g. :

.class2 {
  color: red;
@pebreo
pebreo / gulpfile.js
Last active October 10, 2015 22:22 — forked from soin08/gulpfile.js
//Based on gulpfile.js from Google Web Starter Kit.
//https://github.com/google/web-starter-kit
'use strict';
// Include Gulp & Tools We'll Use
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var del = require('del');
var runSequence = require('run-sequence');
var browserSync = require('browser-sync');
@pebreo
pebreo / payform.html
Created April 3, 2015 18:23
braintree-payment-example
<html>
<form id="checkout" method="post" action="{% url 'recurpayresult' %}">
{% csrf_token %}
<input type="text" name="first_name">
<input type="text" name="last_name">
<div id="dropin"></div>
<input type="submit" value="Pay $25"> <!-- braintree will use this $25 payment -->
</form>
<script src="https://js.braintreegateway.com/v2/braintree.js"></script>