Skip to content

Instantly share code, notes, and snippets.

@whmountains
whmountains / description.markdown
Last active August 29, 2015 14:07
Problems with Tracker.autorun()

I'm trying to write a radio automation app. The version that has to do with this gist is hosted at feathercaster-3e3055d.meteor.com

Pane one shows files and folders. That's irrelevant to the problem.

Pane two shows the contents of the currently open playlist. The toolbar at the top has a playlist switcher. When the user clicks on the dropdown to change the playlist, it fires the event listener located in playlistToolbar.js at line 72. That in turn update the openPlaylistID session variable like this: Session.set('openPlaylistID', playlistID);

I've got a Tracker.autorun() function in playlists.js:23 whose very first line is var openPlaylistID = Session.get('openPlaylistID'); I would expect that the computation would automatically be invalidated and re-run every time the Session variable is changed. That's how things used to work, but I've changed something (I don't know what.), and now that computation never gets re-run. At least, I assume so since

@whmountains
whmountains / groove.js
Created November 10, 2014 21:06
bug with node-groove
var _ = require('lodash');
var groove = require('groove');
var l = require('../../l/l.js');
var util = require('util');
var events = require('events');
var async = require('async');
var EventEmitter = require('events').EventEmitter;
var Debug = require('debug');
@whmountains
whmountains / test.js
Created November 13, 2014 11:51
problems with node-groove
groove = require('groove');
console.log("opening file (1)");
groove.open('t1.mp3', function(err, file) {
console.log("opened file (1)");
if (err) console.log(err);
var playlist = groove.createPlaylist();
playlist.insert(file);
@whmountains
whmountains / Redirector.rjson
Last active August 29, 2015 14:10
prevent various sites from getting past the homepage
{
"createdBy": "Redirector v2.7.1",
"createdAt": "2014-12-01T20:42:47.346Z",
"redirects": [
{
"exampleUrl": "http://www.lego.com/es-ar/city/products/arctic/60062-arctic-icebreaker",
"description": "",
"includePattern": "*lego.com*",
"excludePattern": "http://www.lego.com/es-ar/city",
"redirectUrl": "http://www.lego.com/es-ar/city",
year count
1900 3
1901 2
1902 4
1903 1
1904 1
1905 4
1906 4
1907 3
1908 2
@whmountains
whmountains / build.log
Created August 25, 2015 15:37
crosstool-ng build logs
[INFO ] Performing some trivial sanity checks
[DEBUG] Testing '! ( -n )'
[DEBUG] Testing '! ( -n )'
[DEBUG] Testing '! ( -n )'
[DEBUG] Testing '! ( -n )'
[DEBUG] Testing '! ( -n )'
[DEBUG] Testing '! ( -n )'
[DEBUG] ==> Executing: 'mkdir' '-p' '/Volumes/crosstool-ng/ctng/.build'
[DEBUG] ==> Executing: 'rm' '-f' '/Volumes/crosstool-ng/ctng/.build/backtrace'
[DEBUG] ==> Executing: 'touch' '/Volumes/crosstool-ng/ctng/.build/foo'
.reset-container:not(#nothing):not(#nothing):not(#nothing) * {
animation : none;
animation-delay : 0;
animation-direction : normal;
animation-duration : 0;
animation-fill-mode : none;
animation-iteration-count : 1;
animation-name : none;
animation-play-state : running;
animation-timing-function : ease;
@whmountains
whmountains / main.rs
Created August 2, 2017 14:11
CLI Calculator
use std::io;
use std::io::Write;
// function to write the prompt
fn prompt(message: &str, result: &mut String) {
// print the message and flush the buffer
print!("{}", message);
io::stdout().flush()
.expect("Error flushing output");
@whmountains
whmountains / 01_Readme.md
Last active August 28, 2017 15:34
Rust macro for defining DynamoDB items

This is a Rust macro for defining DynamoDB items for use with rusoto_dynamodb. It also requires that the hashmap! macro from the maplit crate be in scope.

@whmountains
whmountains / Image.js
Last active September 5, 2017 15:18
React Responsive Image Component for Gatsby
import React from 'react'
import styled from 'styled-components'
import autoBind from 'auto-bind'
const Container = styled.div`
position: relative;
overflow: hidden;
background-color: #f6f6f6;
${p => `width: ` + p.width + ';'}
${p => `height: ` + p.height + ';'}