Skip to content

Instantly share code, notes, and snippets.

View barnabyc's full-sized avatar

Barnaby Claydon barnabyc

  • Boston, MA
  • 09:15 (UTC -04:00)
View GitHub Profile
127.0.0.1:6379> zadd myindex 0 "banana:123" 0 "banahhh:1" 0 "banned user:49" 0 "banning:89"
(integer) 4
127.0.0.1:6379> ZRANGEBYLEX myindex "[banana:" + LIMIT 0 10
1) "banana:123"
2) "banned user:49"
3) "banning:89"
127.0.0.1:6379>

Keybase proof

I hereby claim:

  • I am barnabyc on github.
  • I am barnabyclaydon (https://keybase.io/barnabyclaydon) on keybase.
  • I have a public key whose fingerprint is 94D5 D7AB AD13 81E2 CDD3 E1D2 5E3D BEB4 9B84 4A53

To claim this, I am signing this object:

@barnabyc
barnabyc / routes.js
Last active February 7, 2019 11:03
Aviator/React example
import Aviator from 'vendor/aviator';
import ServerRouteTarget from 'route_targets/server_route_target';
let Routes = {
/**
Call this method `Routes.dispatch` to start routing.
@method dispatch
@param {Object} targets
@example { 'nameOfMyRouteTarget': instanceOfMyRouteTarget }
<DataTable
RowComponent={RowComponent}
modelList={this.props.modelList}
visibleRows={this.props.visible}
className="sales-bars">
<thead>
<tr>
<th className="name">ITEM</th>
<th>CURRENT</th>
<th>PREVIOUS</th>
using System.Html;
using System.Runtime.CompilerServices;
using jQueryApi;
[Mixin("$.fn")]
public static class TextPreviewerjQueryPlugin
{
public static jQueryObject TextPreviewerjQuery(TextPreviewerjQueryOptions options)
{
return jQuery.Current.Each(delegate(int i, Element element)
{
Running Primrose specs
--------------------------
-=> enter, level: 0
Matchers
-=> enter, level: 1
toBe
-=> enter, level: 2
it asserts simple matches
-=> enter, level: 3
beforeEach
var request = new Y.JSONPRequest(toolBarUri, {
on: {
success: Y.bind(function(response) {
Y.log("Parsing toolbar configuration", 'info', 'modelDashboard');
return response;
}, this),
failure: Y.bind(function(e) {
Y.log("Failed to get toolbar for dashboard.", "error", "modelDashboard");
@barnabyc
barnabyc / donut-halos.html
Created October 11, 2012 21:48
d3 donut charts with halo data
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Multiple Pie Charts</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.4.5"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?2.4.5"></script>
<style type="text/css">
body { text-align: center }
path { stroke: #fff; stroke-width: 4px; }
<div id="the_div">
<ul id="the_list">
<li id="the_item">Click me!</li>
</ul>
</div>
<p id="log"></p>
<script type="text/javascript" charset="utf-8">
function log(string){
function cachedSin(num) {
this.cache = this.cache || {};
if(this.cache[num] != null) {
console.log('returning from cache...');
return this.cache[num];
}
return this.cache[num] = Math.sin(num);
}