Skip to content

Instantly share code, notes, and snippets.

View davidascher's full-sized avatar

David Ascher davidascher

View GitHub Profile
@creationix
creationix / shed.scad
Last active June 22, 2024 19:06
Shed design. Open in OpenScad to view 3d model.
windows = false; // show windows
stuff = false; // Show bikes, table, mower
l = 32; // Length of building in feet (16, 20, 24, 28, 32, ...)
h = 8*12-4.5+.5;
rl=6*12+1.375+.1; // cut to 73.5" long with 22.5 degree angles
tl = 68.7; // Used to tweak headers on top walls
// 2x6 concrete forms for foundation
// 10" wide grid
@thisandagain
thisandagain / .aliases
Created February 12, 2015 02:23
ADB Aliases
alias devices='adb devices'
alias logcat='adb logcat CordovaLog:D *:S'
alias forward='adb forward tcp:6000 localfilesystem:/data/local/debugger-socket'

To start: there are three locations:

  • your local machine (you're editing files here)
  • your personal remote (this lived on github)
  • the mozilla remote (this also lives on github)

When working on "things", the basic idea is to, before you start editing things, make sure all three locations have the same develop branch. The mozilla remote is the boss here, so the idea is to ask it what the most up to date code is, then update your local machine develop branch to be the same as that, and to then push your local copy up to your personal remote:

$> git fetch mozilla
@davidascher
davidascher / github-tricks
Last active January 4, 2016 06:49
Github tips and tricks from pomax
# When your own develop is ahead of where origin is, but those commits were in error:
davida@suki ~/s/m/appmaker> git fetch origin
davida@suki ~/s/m/appmaker> git checkout -B develop origin/develop
@sjmiles
sjmiles / gist:8478807
Created January 17, 2014 18:28
Dynamic loading imports in Polymer circa 1/17/2014. Will be very much streamlined shortly.
loadLinks: function(urls, callback) {
var doc = document.createDocumentFragment();
urls.forEach(function(url) {
var link = doc.appendChild(document.createElement('link'));
link.rel = "import";
link.href = url;
});
// load-all-links in document method should be factored somewhere
// very similar method used in x-meta
HTMLImports.importer.load(doc, function() {
@davidascher
davidascher / hoodie.Dockerfile
Created November 16, 2013 23:56
FatHoodie Dockerfile -- this is a dockerfile which will setup a hoodie including the couchdb process. I'd like to split out couch into its own container, and link them together for greater flexibility, but this is it for now.
FROM ubuntu
MAINTAINER David Ascher <david.ascher@gmail.com>
# Get us to a stable place
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y python-software-properties
RUN apt-get remove couchdb
@possibilities
possibilities / meteor-async.md
Created August 23, 2012 22:53
Meteor Async Guide

From Meteor's documentation:

In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node. We find the linear execution model a better fit for the typical server code in a Meteor application.

This guide serves as a mini-tour of tools, trix and patterns that can be used to run async code in Meteor.

Basic async

Sometimes we need to run async code in Meteor.methods. For this we create a Future to block until the async code has finished. This pattern can be seen all over Meteor's own codebase:

var orm = require('biggie-orm');
orm.connect();
var Deck = orm.model('Deck', {
name: {type: 'string'},
has_many: ['slides'],
indexes: ['name']
});