Skip to content

Instantly share code, notes, and snippets.

View reduxdj's full-sized avatar

Patrick Lemiuex reduxdj

View GitHub Profile
@reduxdj
reduxdj / tracking.js
Created April 26, 2019 17:06
Tracking Wrapper
/*
TrackingWrapper trackingEvent={{type: EVENTS.ACCOUNT_SIDEBAR_CLICKED}} >
<StyledLinkButton
pathname={pathname}
to="/account"
>
<StyledLinkButton path="wishlists" pathname={pathname} to="/account/wishlists">
<h6>Wishlists</h6>
<svg width="30" x="0px" y="0px" viewBox="0 0 471 448" >
<path fill="#149d43" d="M235.5,0l-72.8,147.5L0,171.1l117.8,114.8L90,448l145.5-76.5L381,448l-27.8-162.1L471,171.1l-162.7-23.7L235.5,0L235.5,0z" />
@reduxdj
reduxdj / collections.coffee
Last active August 29, 2015 14:25 — forked from scottmackenzzz/collections.coffee
Meteor - S3 file upload + thumbnailing
#
# FS Collection
#
profileThumbsStore = new FS.Store.S3('thumb',
accessKeyId : 'XXXXXXXXXXXXXXXXXX'
secretAccessKey : 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
bucket : 'my-bucket-name'
folder : 'thumb'
transformWrite : (fileObj, readStream, writeStream) ->
gm(readStream, fileObj.name()).resize("100", "100").stream().pipe writeStream
Accounts.updateOrCreateUserFromExternalService = function( // 1104
serviceName, serviceData, options) { // 1105
options = _.clone(options || {}); // 1106
// 1107
if (serviceName === "password" || serviceName === "resume") // 1108
throw new Error( // 1109
"Can't use updateOrCreateUserFromExternalService with internal service " // 1110
+ serviceName); // 1111
if (!_.has(serviceData, 'id'))
@reduxdj
reduxdj / app.js
Last active August 29, 2015 14:22 — forked from Tivoli/app.js
'use strict';
import React from 'react';
import Router from 'react-router';
import { canUseDOM } from 'react/lib/ExecutionEnvironment';
import routes from './routes';
let app = {
start(bootstrap) {
return canUseDOM ? this.webStart() : this.serverStart(bootstrap);
@reduxdj
reduxdj / app.js
Last active August 29, 2015 14:22 — forked from Tivoli/app.js
'use strict';
import React from 'react';
import Router from 'react-router';
import { canUseDOM } from 'react/lib/ExecutionEnvironment';
import routes from './routes';
let app = {
start(bootstrap) {
return canUseDOM ? this.webStart() : this.serverStart(bootstrap);
// includes bindings for fetching/fetched
var PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage');
typeof(options) != 'undefined' || (options = {});
this.page = 1;
typeof(this.perPage) != 'undefined' || (this.perPage = 10);
},
fetch: function(options) {
@reduxdj
reduxdj / gist:6893271
Last active March 23, 2020 10:48
QuadCopter Parts List
Here's the parts list available through http://HobbyKing.com
1x #9171000073/24723 Hobbyking KK2.0 Multi-rotor LCD Flight Control Board
4x #9351000004/25365 Turnigy Multistar 30 Amp Multi-rotor Brushless ESC 2-4S
4x #D2830-111000/28115 D2830-11 - Brushless Motors
1x #T1800 .3S.30/9369 Turnigy 1800mAh 3S 30C Lipo Pack
2x #OR017 -01001-M2/6360 Hex-nuts M2 10pc
2x #HA0505 /12307 Hex Screw M2x8 (20pcs)
1x #9329000018/22438 Slow Fly Electric Prop 8045SF (4 pc)
1x #9329000019/22439 Slow Fly Electric Prop 8045R SF (4 pc)
1x #9171000033/23140 Hobby King Quadcopter Power Distribution Board
#!/bin/bash
#
# Note: This is the only file you *really* need. I've copied the contents
# of the important files that are part of our git repo for easier reading
# below :)
#
# I've prefixed this file with two dots to make it rise to the top of the
# gist. you can ignore those
#
@reduxdj
reduxdj / watcher.coffee
Created June 14, 2012 11:51
WatcherUtil
fs = require 'fs'
fileUtil = require 'file'
path = require 'path'
nodeWatch = require 'nodewatch'
child_process = require 'child_process'
_ = require 'underscore'
glob = require 'glob'
util = require 'util'
exec = require('child_process').exec
@reduxdj
reduxdj / pandora_jar.js
Created November 15, 2011 16:57
Pandora ad hacker bookermarklet
/*
* Pandora has changed their dom recently and also did some insidious things
* like trying to check to see if the ads are in the body or playback occasionally
* stops at which you have to reload the page because of some random interval
* checking pandora does, although playback is resumed from the current point, thanks
* to Pandora. This doesn't happen very often, and I am working on a better fix for that.
*
* It's a total cat and mouse game, but I'll update the code regularly,
* so use at your own risk...
*