Skip to content

Instantly share code, notes, and snippets.

View martinstannard's full-sized avatar
🏠
working from home

Martin Stannard martinstannard

🏠
working from home
View GitHub Profile
@laky
laky / gist:79a266f10c90f1d8387e269ad208addd
Created January 23, 2023 11:25
Thiago Tweet Articles
Tweet link: https://twitter.com/thiagoghisi/status/1617249812432424960
Articles:
https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/
https://web.archive.org/web/20130721011202/http://agile2003.agilealliance.org/files/R1Paper.pdf
http://agilemodeling.com/essays/generalizingSpecialists.htm
https://brettsbabble.wordpress.com/2011/03/26/patterns-for-effective-acceptance-criteria/
https://www.joelonsoftware.com/2002/11/11/the-law-of-leaky-abstractions/
http://www.exampler.com/testing-com/writings/coverage.pdf
https://mike-bland.com/2012/07/10/test-mercenaries.html
// by dave @beesandbombs
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active July 7, 2024 19:32
A badass list of frontend development resources I collected over time.
@machty
machty / new-router-examples.md
Last active April 16, 2020 22:03
How to do cool stuff with the new Router API
@ivanvanderbyl
ivanvanderbyl / account_routes.js
Last active January 31, 2016 17:55
Using Ember initializers and injections to setup the `currentUser` within your app.
App.AccountEditRoute = Ember.Route.extend({
setupController: function(controller) {
controller.set('content', this.get('currentUser'));
}
});
@chsh
chsh / app_delegate.rb
Created May 7, 2012 10:18
Example to use UIWebView for RubyMotion.
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
@window = UIWindow.alloc.initWithFrame UIScreen.mainScreen.bounds
@window.rootViewController = GoogleViewController.alloc.init
@window.makeKeyAndVisible
true
end
end
@mindscratch
mindscratch / 1_intro_to_subject.rb
Created February 29, 2012 18:11 — forked from knzai/1_intro_to_subject.rb
A pattern for testing class methods in ruby with rspec explicit subjects
# RSpec's subject method, both implicitly and explicitly set, is useful for
# declaratively setting up the context of the object under test. If you provide a
# class for your describe block, subject will implicitly be set to a new instance
# of this class (with no arguments passed to the constructor). If you want
# something more complex done, such as setting arguments, you can use the
# explicit subject setter, which takes a block.
describe Person do
context "born 19 years ago" do
subject { Person.new(:birthdate => 19.years.ago }
it { should be_eligible_to_vote }
@elidupuis
elidupuis / handlebars-helpers.js
Last active December 7, 2021 02:24
Simple Handlebars.js helpers
/*! ******************************
Handlebars helpers
*******************************/
// debug helper
// usage: {{debug}} or {{debug someValue}}
// from: @commondream (http://thinkvitamin.com/code/handlebars-js-part-3-tips-and-tricks/)
Handlebars.registerHelper("debug", function(optionalValue) {
console.log("Current Context");
console.log("====================");
// Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/
var metas = document.getElementsByTagName('meta');
var i;
if (navigator.userAgent.match(/iPhone/i)) {
for (i=0; i<metas.length; i++) {
if (metas[i].name == "viewport") {
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
}
}