Skip to content

Instantly share code, notes, and snippets.

View bredfern's full-sized avatar

Brian Redfern bredfern

View GitHub Profile
@bredfern
bredfern / index.js
Created January 30, 2017 23:59 — forked from Fedia/index.js
🌀 Eddy: Static Websites For The Rest of Us
//- polyfills
'use strict';
(function (p) {
if (!p.matches) p.matches = p.webkitMatchesSelector || p.mozMatchesSelector || p.msMatchesSelector;
})(Element.prototype);
if (typeof window.CustomEvent !== 'function') {
window.CustomEvent = function (name, p) {
p = p || {};
@bredfern
bredfern / index.html
Last active December 7, 2016 07:40
Sortable Circle on the end of a Div
<div id="content">
<ul id="tasks">
<li>
<div class="outer-circle">
<div class="inner-circle orange-bg">
<span class="inside-content"></span>
</div>
Broken Iphone <i class="material-icons right gray">rss_feed</i>
</div>
@bredfern
bredfern / css-5-steps-progress-bar.markdown
Created December 5, 2016 21:30
CSS 5 steps progress bar
@bredfern
bredfern / gist.md
Last active November 28, 2016 02:09

Bloc Gists

Javascript

With Javascript we have to learn to think in functions. You got it partly right with the way you attach your behavior to the button click.

But we need a named function to wrap your code to get it behave as expected.

This is how your code needs to be changed into order to work correctly:

@bredfern
bredfern / tf_beam_decoder.py
Created November 7, 2016 19:41 — forked from nikitakit/tf_beam_decoder.py
Tensorflow Beam Search
"""
Beam decoder for tensorflow
Sample usage:
```
beam_decoder = BeamDecoder(NUM_CLASSES, beam_size=10, max_len=MAX_LEN)
_, final_state = tf.nn.seq2seq.rnn_decoder(
[beam_decoder.wrap_input(initial_input)] + [None] * (MAX_LEN - 1),
@bredfern
bredfern / Flattening an arbitrarily complex list with Ruby
Last active October 7, 2016 04:21
The polish method is used to take a really messy array of arbitrarily complex nested items and produce a simple array of integers as a result. You can statically call this from the module, SmoothArray.polish(my_complex_array).
module SmoothArray
# Sample usage:
# require SmoothArray
# ugly_array = [[1,2,[3]],4]
# result = []
# result = SmoothArray.polish(ugly_array)
# result.each do |i|
# puts i.to_s
# end
Tempo-Synced LFO Wobble Bass
Jacob Joaquin
July 10, 2011
jacobjoaquin@gmail.com
csoundblog.com
<CsoundSynthesizer>
<CsInstruments>
sr = 44100
kr = 44100
# A simple Makefile alternative to using Grunt for your static asset compilation
#
## Usage
#
# $ npm install
#
# And then you can run various commands:
#
# $ make # compile files that need compiling
# $ make clean all # remove target files and recompile from scratch
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Sample Form</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script>
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<script type="text/javascript">
@bredfern
bredfern / html5-video-streamer.js
Created December 8, 2015 00:43 — forked from paolorossi/html5-video-streamer.js
Node.js HTML5 video streamer
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
*/
var http = require('http'),
fs = require('fs'),
util = require('util');
http.createServer(function (req, res) {
var path = 'video.mp4';