Skip to content

Instantly share code, notes, and snippets.

View chrisbautista's full-sized avatar
🕶️

Chris Bautista chrisbautista

🕶️
View GitHub Profile
<div id="container" ng-controller="cbTimerCtrl">
<div >
<div id="clock">{{timer}}</div>
<button ng-click="toggleTimer()">{{mode}}</button>
</div>
<div>
<table>
<thead>
<tr><th>Start</th><th>End</th><th>Duration (secs)</th></tr>
</thead>
@chrisbautista
chrisbautista / app.js
Last active August 29, 2015 14:07
AngularJS Timer: timeout #2
var tmPromise, myApp = angular.module('cbTimer',[]);
...
function startTimer () {
// toggle
$scope.mode = "Stop";
// compute for the duration,
@chrisbautista
chrisbautista / app.js
Last active August 29, 2015 14:07
AngularJS Timer: Stop Timer
/**
* @func stopTimer
* handle end of timer
*/
functio stopTimer () {
var dt = new Date();
// toggle
$scope.mode = "Start";
@chrisbautista
chrisbautista / Git Cheatsheet.md
Last active August 29, 2015 14:07
Git Cheatsheet
@chrisbautista
chrisbautista / curried_sum.js
Last active August 29, 2015 14:27
Functional Javascript: currying
/****
*
* CURRYING
*
* Chris Bautista <chris@codespud.ca>
* @chrisbautista
*
****/
(function(){
@chrisbautista
chrisbautista / README_TEMPLATE.md
Created August 23, 2015 01:47
Project Template README

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@chrisbautista
chrisbautista / parens_noloops.js
Last active August 27, 2015 17:36
Functional: Balanced Parens
/**
* parens exercise
*
* chris bautista < chris@codespud.ca >
*
****/
(function(){
var startParens = [ '[','{','(' ];
@chrisbautista
chrisbautista / maxprofit.js
Last active May 20, 2016 16:59
Stocks Max Profit ( recursive )
/**
*
* get max profit from stock prices
*
* chris bautista <chris@codespud.ca>
*
* */
/**
@chrisbautista
chrisbautista / README.md
Last active August 27, 2015 20:11
Using array functions : Product except at index ( recursive )

Problem:

You have an array of integers, and for each index you want to find the product of every integer except the integer at that index. Write a function get_products_of_all_ints_except_at_index() that takes an array of integers and returns an array of the products.

For example, given:

[1, 7, 3, 4] your function would return:

@chrisbautista
chrisbautista / README.md
Last active October 24, 2016 14:10
Highest Product of 3 integers

Problem:

Given an array_of_ints, find the highest_product you can get from three of the integers. The input array_of_ints will always have at least three integers.

Gotchas

Does your function work with negative numbers? If array_of_ints is [-10, -10, 1, 3, 2][−10,−10,1,3,2] we should return 300 (which we get by taking −10∗−10∗3).