Skip to content

Instantly share code, notes, and snippets.

😀

Devin Rhode devinrhode2

😀
Block or report user

Report or block devinrhode2

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View composableisValidate.js
// 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))
@ernsheong
ernsheong / access-mac-localhost-from-parallels-desktop-ie-edge.md
Last active Dec 11, 2019
Accessing macOS localhost from Parallels Desktop IE or Edge
View access-mac-localhost-from-parallels-desktop-ie-edge.md

Access macOS localhost from IE or Edge within Parallels Desktop

This issue is so infuriating that I'm going to take some time to write about it.

  1. MOST IMPORTANT. Your local development server must be bound to IP address 0.0.0.0. Some do this by default, but many don't. You need to make sure that you run your local server with correct IP bindings. You may need to provide additional flags to your serve commands e.g. polymer serve --hostname domain.local, hugo serve --bind 0.0.0.0. If you use a named domain like domain.local, it has to be defined in /etc/hosts and pointing at 0.0.0.0.

  2. My Parallels setting is using Shared Network, nothing special there.

  3. Open macOS Terminal and type ifconfig. Look for the value under vnic0 > inet. It is typically 10.211.55.2.

View css-blocks-form-example.md

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>
@swannodette
swannodette / inference.md
Last active Nov 28, 2019
Externs Inference
View inference.md

Externs Inference

Integrating third party JavaScript libraries not written with Google Closure Compiler in mind continues to both be a source of error for users when going to production, and significant vigilance and effort for the the broader community (CLJSJS libraries must provide up-to-date and accurate externs).

In truth writing externs is far simpler than most users imagine. You only need externs for the parts of the library you actually intend to use from ClojureScript. However this isn't so easy to determine from Closure's own documentation. Still in the process of writing your code it's easy to miss a case. In production you will see the much dreaded error that some mangled name does not exist. Fortunately it's possible to enable some compiler flags :pretty-print true :pseudo-names true to generate an advanced build with human readable names. However debugging missing externs means compiling your production build for each missed case. So much time wasted for such simple mistakes damages our sen

@aaugustin
aaugustin / question.md
Last active Jan 16, 2020
Accessibility in browsers: zoom level vs. font size
View question.md

Scroll to the bottom for the answer

Question

There's two ways to increase the default font size in browsers:

  1. set a default zoom level > 100% ("page zooming")
  2. set a default font size > 16px ("text scaling")

Option 1 relies on the browser's proportional scaling. This feature was

@rwjblue
rwjblue / application.controller.js
Created Dec 14, 2015 — forked from barneycarroll/application.controller.js
Can't access object values by dynamic key in Handlebars
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
numbers:['1','2','3','4'],
letters:['a','b','c','d']
});
@RSNara
RSNara / decorators.js
Last active Jul 7, 2019
An example of using decorators in ES5.
View decorators.js
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;
@belohlavek
belohlavek / binaryUtil.js
Last active Jan 1, 2020
ASCII to Binary and Binary to ASCII Utility functions in Javascript.
View binaryUtil.js
var Util = {
toBinary: function(input) {
var result = "";
for (var i = 0; i < input.length; i++) {
var bin = input[i].charCodeAt().toString(2);
result += Array(8 - bin.length + 1).join("0") + bin;
}
return result;
},
View gist:b58d56e5a47db4128a0a

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

View gist:8738842
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
You can’t perform that action at this time.