Skip to content

Instantly share code, notes, and snippets.

$('#search').keyup(function () {
var searchField = $('#search').val();
var regExp = new RegExp(searchField, 'i');
$.getJSON('data.json', function (data) {
var results = [];
var output = $('<ul>').addClass('output');
var results = $.map(data, function(value, key) {
55 available characters for: #perthtraffic: Kwinana Fwy Sthbnd at Berrigan Dr off-ramp, South Lake - crash cleared
72 available characters for: #perthtraffic: Kwinana Fwy at Mundijong Rd, Baldivis - CAUTION - fog
42 available characters for: #perthtraffic: Kwinana Fwy Sthbnd at Berrigan Dr off-ramp, South Lake - LEFT LANE BLOCKED - crash
54 available characters for: #perthtraffic: Kwinana Fwy Sthbnd at Berrigan Dr off-ramp, South Lake - CLOSED - crash
43 available characters for: #perthtraffic: Kwinana Fwy Sthbnd at Berrigan Dr off-ramp, South Lake - LEFT LANE BLOCKED - crash
48 available characters for: #perthtraffic: Charles St and Scarborough Beach Rd intersection, North Perth - crash cleared
35 available characters for: #perthtraffic: Great Eastern Hwy Wstbnd under Graham Farmer Fwy overpass, Burswood - vehicle fire cleared
46 available characters for: #perthtraffic: Charles St and Scarborough Beach Rd intersection, North Perth - CAUTION - crash
55 available characters for: #perthtraffic: Kwinana Fwy Nth
var fs = require('fs');
var zlib = require('zlib');
var tar = require('tar');
var stream = fs.createReadStream('twbs-bootstrap-v3.2.0-0-gc068162.tar.gz').on('error', console.log);
stream.pipe(zlib.Unzip())
.pipe(tar.Parse())
.on('entry', function(e) {
var path = e.props.path;
if(/^.*\/docs/.test(path)) console.log(path);
// GV Slider
"use strict";
var gvcharts = gvcharts || {};
gvcharts.defaults = {
margin: {top: 80, right: 80, bottom: 240, left: 200},
padding: 20,
axisBorder: 4,
;(function($, window) {
var defaults = {
duration: 1000,
delay: 500,
hideTree: 'hideTree',
showTree: 'showTree'
}
function accordion(el,options) {
function pullProperties = function(obj, props) {
return _.filter(obj, function(prop) {
return _.includes(props, prop);
})
}
Slider.prototype.getActual = function(dataset) {
if(!dataset.actual) return [];
_.map(dataset.actual, function(item) {
return pullProperties(item, ['output', 'minValue','maxValue']);
@karlbright
karlbright / gist:ad327fe5b2ec985eef30
Created March 26, 2015 23:21
Temporary Periscope Scheduling Idea
Upon visiting main page you see list of other scheduled events coming up soon.
Login via twitter to create your own
Give it a title and date/time and create.
Taken to countdown page, you can use that link to post to twitter etc.
Once countdown ends, the app checks your recent tweets for a "LIVE on #Periscope" tweet and sets up redirect to live page.
Ability to tweet about reminders at 3hr and 6hr before schedule start
Ability to cancel.
Simple solution but this is probably a little nicer than just a listing and times. With the web viewer in place you could even just embed the live video in the scheduling site page and show the LIVE scheduled events on the frontpage somewhere.
import mongoose from 'mongoose'
let CitySchema = new mongoose.Schema({
name: { type: String, required: true },
country: { type: String, required: true },
province: { type: String, required: true },
location: { type: [Number], required: true, index: '2d' }
})
CitySchema.pre('validate', next => {
@karlbright
karlbright / pitchesagainsthumanity.md
Last active August 29, 2015 14:19
Pitches Against Humanity

Pitches Against Humanity

Designed to be used as an ice breaker at events such as Startup Weekend.

Pick 2-3 random white cards and 1 black card. You are given 5~ minutes to come up with an idea based on the white cards and pitch it. You must include the black card statement/question within your pitch.

You may wish to filter some of the cards before playing. For example, some black cards are quite hard to work into a pitch, such as the "make a haiku" card and others. The easiest cards to use within a pitch are the question-based black cards.

Additionally, you may wish to filter some white cards out if you consider them "NSFW", keep in mind though that this IS Cards Against Humanity we are talking about. The results will be absurd.

import React from 'react'
import {Link, State} from 'react-router'
import Superagent from 'superagent'
// <RepoDetail name='collabtracks' author='karlbright' />
class RepoDetail extends React.Component {
componentWillMount() {
this.loadDetails(this.props.author, this.props.name);
}