Skip to content

Instantly share code, notes, and snippets.

View devinrhode2's full-sized avatar
😀

Devin Rhode devinrhode2

😀
View GitHub Profile
Hi David
I'm impressed with your back ground and your responsibilities at 37signals. When researching your profile I also found that you have 4.8K followers and have been starred 29 times on GitHub. This speaks volumes to your work and your high technical expertise. I'd love the opportunity to speak with you about a Ruby Engineering role I'm currently working on for Heroku. I'd like to share more details about the position and find out if you or anyone you know would be interested.
Heroku is a Platform as a Service (PaaS) that lets you deploy, run and manage applications written in Ruby, Node.js, Java, Python, Clojure and Scala. Heroku is owned by Salesforce however, we operate as a completely separate entity. This allows us to maintain our technology, culture and the formula that has made us so successful.
Anyway, it would be great to set up sometime to chat. I am more than happy to answer any questions that you might have and it would be great for me to hear about what you are looking for in any potentia
//THIS IS NOW SHIELD.JS github.com/devinrhode2/shield.js
/**
* (function(){
* ..code..
* }).runInTryCatch();
* Shorthand to run function in a TraceKit try/catch block.
*
* Prototype is less loud than:
* runInTryCatch(function(){
* ..code..

A small sampling of external projects initially built for Ember use but designed to be used standalone:

An example of a simple form

Consider the following markup:

<form class="root" state:theme=dark state:compact>
  <div class="input-area">
    <label for="username" class="label">Username:</label>
    <input id="username" class="input" type="text">
  </div>
// It's composable
const compose = (a,b) => v => a(b(v))
const isValid = valid => fn => (...p) => valid(...p) && fn(...p)
const hasTwoParams = isValid((...params) => params.length === 2)
const firstParamIsArray = isValid(a => Array.isArray(a))
const hasTwoFirstArray = compose(hasTwoParams, firstParamIsArray)
const myValidatedFn = hasTwoFirstArray((a, b) => console.log('It worked', a, b))
@devinrhode2
devinrhode2 / typeCheck.js
Last active November 19, 2018 21:14
Working on a typeCheck function
function postTweet(tweet /*string*/, from /*string*/) {
typeCheck(arguments);
}
postTweet('string', 'asdf');
postTweet('string', 222); //TypeError! run in console to see a nice error message!
function typeCheck(a) {
var newArr = [].slice.call(a);
var types = [];
var f = a.callee.toString();
@Raynos
Raynos / jQuery.md
Created January 14, 2012 22:44
Why you don't need jQuery

Why the jQuery Abstraction isn't needed.

(One needs some form of browser normalization so that modern features works, no-one is doubting that).

Related: [jQuery library critique][2]

Abstractions that aren't needed

Selectors

@devinrhode2
devinrhode2 / StrictjQuery.js.markdown
Last active November 27, 2018 17:12
warn on empty jquery selection badSelectorAction devinrhode2

warn on empty jquery selection

Graduated to github: https://github.com/devinrhode2/StrictjQuery.js

But for the simple version (quite possibly better): (wait no its broke use the one on GH)

Warns when you have an empty jQuery selection, unless you do $('foo', failsafe);

 $.badSelectorAction = function badSelectorActionFn( selector, context ) {
@RSNara
RSNara / decorators.js
Last active July 7, 2019 00:24
An example of using decorators in ES5.
function memoize(object, name, descriptor) {
var fn = descriptor.value;
var memoized = function() {
memoized.cache = memoized.cache || {};
var key = JSON.stringify(arguments);
return memoized.cache[key] = memoized.cache[key]
? memoized.cache[key]
: fn.apply(this, arguments);
}
descriptor.value = memoized;
@rwjblue
rwjblue / application.controller.js
Created December 14, 2015 18:07 — forked from barneycarroll/application.controller.js
Can't access object values by dynamic key in Handlebars
import Ember from 'ember';
export default Ember.Controller.extend({
numbers:['1','2','3','4'],
letters:['a','b','c','d']
});