Skip to content

Instantly share code, notes, and snippets.

View pootsbook's full-sized avatar

Philip Poots pootsbook

  • ClubCollect
  • Alphen aan den Rijn, NL
View GitHub Profile
@holman
holman / emoji_test.rb
Last active June 18, 2020 01:27
A snapshot of the tests we use internally at GitHub to help edit our blog posts before they go out to everybody. For more information, take a peek at http://zachholman.com/posts/how-github-writes-blog-posts
require_relative "test_helper"
require "open-uri"
require "net/http"
class EmojiTest < Blog::Test
def test_no_emoji
posts.each do |post|
content = File.read(post)
refute_match /:[a-zA-Z0-9_]+:/, content,
@bryanaka
bryanaka / hybrid-resolver.js
Last active August 29, 2015 14:14
Ember-Rails to Ember CLI
import Ember from 'ember';
import EmberResolver from 'ember/resolver';
var Em = Ember;
var HybridResolver = EmberResolver.extend({
resolveOther: function(parsedName) {
var factory = this.resolveGlobal(parsedName);
if(factory) { return factory; }
// declaration
function foo (n) { return n + 1; }
// expression
// note, fat arrow functions have very different meaning (usually what I want, though)
var foo = function (n) { return n + 1; };
var foo = (n) => { return n + 1; };
var foo = n => n + 1;
// object methods
@eccegordo
eccegordo / intro-to-ember-cli-node.md
Created March 21, 2015 11:14
Introduction to Ember CLI, Node and NPM

Introduction To Node, NPM and Ember CLI

This guide is for developers who are new Node, NPM, and Ember CLI. This guide is designed to get you started with ember cli development and provide some general background info on what Node is and how it works with Ember CLI.

Overview

  • What is Node?
  • What is NPM?
  • How do I setup my environment if I don't have node js or npm installed?
  • I accidently installed something wrong how can I start over?
@lukemelia
lukemelia / note.txt
Created April 8, 2015 04:34
When Error: watch EMFILE strikes (OS X)
This requires `brew install jq` which is a command json query.
I got this from @krisselden
import Ember from 'ember';
import XHR from 'ember-xhr';
/**
* On the rails server, this creates an active record that stores the
* filename and generates the pre-signed url, the return format is
* something like:
*
* {
* "upload": {
@ef4
ef4 / select.hbs
Last active October 7, 2021 09:41
Goodbye old Select View
<select onchange={{action (mut vehicle) value="target.value"}}>
{{#each vehicles key="@item" as |vehicleChoice|}}
<option value={{vehicleChoice}} selected={{eq vehicle vehicleChoice}}>{{vehicleChoice}}</option>
{{/each}}
</select>
@mgold
mgold / using_mailboxes_in_elm.md
Last active March 24, 2020 16:05
Using Mailboxes in Elm: a tutorial blog post

Using Mailboxes in Elm

Max Goldstein | July 30, 2015 | Elm 0.15.1

In Elm, signals always have a data source associated with them. Window.dimensions is exactly what you think it is, and you can't send your own events on it. You can derive your own signals from these primitives using map, filter, and merge, but the timing of events is beyond your control.

This becomes a problem when you try to add UI elements. We want to be able to add checkboxes and dropdown menus, and to receive the current state of these elements as a signal. So how do we do that?

The Bad Old Days

-- paste into http://elm-lang.org/try and click "compile"
-- http://imgur.com/gallery/W6TwgZw
import Graphics.Collage exposing (..)
import Graphics.Element exposing (..)
import Text
import Color exposing (..)
import Time
import Signal