Skip to content

Instantly share code, notes, and snippets.

View ungoldman's full-sized avatar
🤔
💭

Nate Goldman ungoldman

🤔
💭
View GitHub Profile
server.route({
method: 'get',
path: '/some/proxy',
handler: function (request, reply) {
request.query.something = 'whatever_static_value';
reply.proxy({
uri: 'http://some.upstream',
onResponse: function (err, res, request, reply, settings, ttl) {
@glv
glv / experience_teaching_ruby_testing.md
Last active November 3, 2019 14:00
@tenderlove asked about the wisdom of teaching RSpec to new Ruby developers. I have some relevant experience. Here it is, for what it's worth.

Notes on teaching both test/unit and RSpec to new Ruby developers

@tenderlove asked "Is it good to teach RSpec (vs t/u) to people who are totally new to Ruby?" I have experience suggesting that it is a good thing; after a short back and forth, it seemed useful to write it up in detail.

Background

This goes back several years, to when I was the primary Ruby/Rails trainer for Relevance from 2006-2009. I'm guessing that worked out to probably 6-8 classes a year during those years. Since then, RSpec has changed a fair amount (with the addition of expect) and test/unit has changed radically (it has an entirely new implementation, minitest, that avoids some of the inconsistencies that made test/unit a bit confusing during the time I'm writing about here).

I started out as an RSpec skeptic. I've never been afraid of what a lot of people denigrate as "magic" in Ruby libraries … to me, if you take the trouble to understand it, that stuff's just pr

@trevnorris
trevnorris / perf-flame-graph-notes.md
Last active December 24, 2023 05:25
Quick steps of how to create a flame graph using perf

The prep-script.sh will setup the latest Node and install the latest perf version on your Linux box.

When you want to generate the flame graph, run the following (folder locations taken from install script):

sudo sysctl kernel.kptr_restrict=0
# May also have to do the following:
# (additional reading http://unix.stackexchange.com/questions/14227/do-i-need-root-admin-permissions-to-run-userspace-perf-tool-perf-events-ar )
sudo sysctl kernel.perf_event_paranoid=0
@justinabrahms
justinabrahms / gist:8994424
Created February 14, 2014 01:51
A simple HTTP proxy for speedy static file serving, sending dynamic requests to a backend web server.
/**
* A proxy for loading static files in development. Django doesn't handle this well.
*
* To run, do something like:
* npm install .
* node proxy.js --docroot=$PWD
*
* Then just visit http://localhost:9000/ as you normally would.
*/
var httpProxy = require('http-proxy');
@JeffreyWay
JeffreyWay / tip.sh
Created August 15, 2013 17:51
Ever want to undo everything that you've worked on since the last commit (including adding new files)? Here's a little alias to help with that.
alias gundo='git reset HEAD~ && git clean -df'

I wrote this in early January 2012, but never finished it. The research and thinking in this area led to a lot of the design of Yeoman and talks like "Javascript Development Workflow of 2013", "Web Application Development Workflow" and "App development stack for JS developers" (surpisingly little overlap in those talks, btw).

Now it's June 2013 and the state of web app tooling has matured quite a bit. But here's a snapshot of the story from 18 months ago, even if a little ugly and incomplete. :p


In the beginning…

  • Intro to tooling
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active March 27, 2025 08:16
A badass list of frontend development resources I collected over time.
@funkjedi
funkjedi / marionette.handlebars.js
Last active April 5, 2024 14:29
Integrates Handlebars with Marionette. First attempts to load pre-compiled templates, then by selector, and finally via XHR.
/**
Usage: Just include this script after Marionette and Handlebars loading
IF you use require.js add script to shim and describe it in the requirements
*/
(function(Handlebars, Marionette) {
Marionette.Handlebars = {
path: 'templates/',
extension: '.handlebars'
};
define([
"dojo/query",
"dojo/NodeList-manipulate",
"dojo/NodeList-dom",
"dojo/NodeList-traverse"
"dojo/NodeList-html",
"dojo/NodeList-data"
], function($){
return $;
});
@JohnDMathis
JohnDMathis / ModuleHelper - simple
Created April 25, 2013 21:55
Loads template files dynamically for a Marionette's Module.
Marionette.ModuleHelper = (function(Marionette, _) {
"use strict";
var moduleHelper = { };
moduleHelper.templatePath = 'templates/';
moduleHelper.templateExt = ".html";
moduleHelper.templatePrefix = "";