Skip to content

Instantly share code, notes, and snippets.

View dabblet.css
.container {
text-shadow: 0.1em 0.1em pink;
}
.larger {
font-size: 30px;
}
.large-shadow {
font-size: 30px;
@sch
sch / server.ts
Created Mar 14, 2019
Handling routes with a function instead of middleware
View server.ts
import * as express from "express";
const server = express();
server.get("/posts", withAuthenticatedUser(function(req, res, user) {
const posts = getPostsForUser(user);
res.json(posts);
}));
@sch
sch / Main.elm
Last active Jan 30, 2019
Minimum Elm boilerplate
View Main.elm
module Main exposing (main)
import Browser
import Html exposing (Html, button, div, text)
import Html.Events exposing (onClick)
type alias Model =
{ count : Int }
@sch
sch / README.md
Last active Sep 30, 2018
Elm as an NPM dependency
View README.md

Sometimes you may want to have more than one version of Elm installed on your computer.

It could be that you're in the process of upgrading multiple projects, and you'd like to have one in 0.18 and another in 0.19. It could be you want to pin your version of Elm to something specific so you can be sure all the members of your team are using the same one. It could be you're relying on lots of Elm-related tooling, and you want to make sure you have the right combination for a specific project.

One option is to piggy-back on top of the [Node Package Manager][npm], and explicitly declare which version of Elm you'd like to use. The elm binary is wrapped up as a node module with a bit of metadata:

$ npm info elm@latest

elm@0.19.0-bugfix2 | BSD-3-Clause | deps: 1 | versions: 33
View keybase.md

Keybase proof

I hereby claim:

  • I am sch on github.
  • I am schaedle (https://keybase.io/schaedle) on keybase.
  • I have a public key ASBSgEE6xKGv4W9Ds7EPdZN6LnICezwpCxWiYPw7Wan6kgo

To claim this, I am signing this object:

@sch
sch / namespace.clj
Last active Oct 25, 2015
Clojure namespace wishlist
View namespace.clj
(ns om-tutorial.core
(:require [goog.dom :as gdom]
[om.next :as om :refer-macros [defui]]
[om.dom :as dom]
[cljs.pprint]))
;; simple maps do it better:
(ns om-tutorial.core
(:require [goog.dom {:alias gdom}]
View quix.txt
bit javascript:var%20e=document.createElement('script');e.setAttribute('language','javascript');e.setAttribute('src','http://bit.ly/bookmarklet/load.js');document.body.appendChild(e);void(0); Make a bit.ly link
cal javascript:var%20s;if(window.getSelection){s=window.getSelection();}else{s=document.selection.createRange().text;}var%20t=prompt('Please%20enter%20a%20description%20for%20the%20event',s);if(t){void(window.open(encodeURI('http://www.google.com/calendar/event?ctext='+t+'&action=TEMPLATE&pprop=HowCreated%3AQUICKADD'),'gcal'));}else{void(s);} Add event to Google Calendar
eye javascript:void(window.open('http://tineye.com/search?pluginver=bookmark_1.0&url='%20+%20encodeURIComponent(document.URL))); TinyEye: Where's this image from?
gsub javascript:var%20b=document.body;if(b){void(z=document.createElement('script'));void(z.src='http://www.google.com/reader/ui/subscribe-bookmarklet.js');void(b.appendChild(z));}else{location='http://www.google.com/reader/vie
You can’t perform that action at this time.