Skip to content

Instantly share code, notes, and snippets.

View anthony-dandrea's full-sized avatar

Anthony D'Andrea anthony-dandrea

  • Milwaukee, WI
View GitHub Profile
@anthony-dandrea
anthony-dandrea / gist:2dc50bc8143bfd02ad17
Last active August 29, 2015 14:19
Python Webassets example

In my site.py I just need to import webassets. I'm using the flask flavor but there's one for every major python framework. https://webassets.readthedocs.org/en/latest/

from flask.ext.assets import Environment, Bundle

Then in my base.html for sass/compass and css minification I have a filter like this:

{% assets filters='compass,scss,cssmin', depends='styles/**/*.scss', output='styles/site.min.css', 'styles/site.scss'%}
  <link rel="stylesheet" type="text/css" href="{{ ASSET_URL }}">
{% endassets %}
@anthony-dandrea
anthony-dandrea / hw_nov_12_2014
Last active August 29, 2015 14:08
HW Nov 12th 2014
// 1. I feel like you already answered the question.
// But say if the very first case in winCombos is a win,
// the reduce method will go through the rest of the cases
// regards of the early win find.
// 2. 21 times because total of 8 winCombos and 3 within
// each. So 8 - 1 = 7, 7 * 3 21.
// 3. When it would be iterating through the last winCombos
// and finds the [0] != [1] in the array.
@anthony-dandrea
anthony-dandrea / gist:0f39eab2607f54d09a02
Last active August 29, 2015 14:07
Eloquent JS Ch. 4
var range = function(start, end, step){
var range = [];
if (step === undefined) { step = 1;} //fuck you JS
var pushToRange = function(num) {
range.push(num);
};
if (start < end) {
for (var num = start; num <= end; num += step) {