Skip to content

Instantly share code, notes, and snippets.

View justgage's full-sized avatar

Gage Peterson justgage

View GitHub Profile
@thunklife
thunklife / packages.el
Created July 6, 2015 21:33
elm-mode for Spacemacs
;;; packages.el --- elm Layer packages File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
@mudge
mudge / gist:1076046
Created July 11, 2011 15:06
JavaScript version of ActiveSupport's to_sentence method.
function toSentence(array) {
var wordsConnector = ", ",
twoWordsConnector = " and ",
lastWordConnector = ", and ",
sentence;
switch(array.length) {
case 0:
sentence = "";
break;
@myguidingstar-zz
myguidingstar-zz / index.html
Last active March 5, 2016 02:33
Clojurescript/Om simple slideshow
<html>
<head>
<style type="text/css">
.slider{
margin:50px auto;
width:500px;
height:300px;
overflow:hidden;
position:relative;
border:5px solid #eaeaea;

Elm 0.17.1

Install

This is a patch release. Everything is the same, just slightly better!

The main changes are:

  • Default dependencies in elm-package.json are elm-lang/core and elm-lang/html.
  • Error messages for elm-package are improved (e.g. this and this)
@Sigmus
Sigmus / gulpfile.js
Last active November 15, 2017 11:55
gulpfile.js with browserify, reactify, watchify and gulp-notify.
var source = require('vinyl-source-stream');
var gulp = require('gulp');
var gutil = require('gulp-util');
var browserify = require('browserify');
var reactify = require('reactify');
var watchify = require('watchify');
var notify = require("gulp-notify");
var scriptsDir = './scripts';
var buildDir = './build';
@rferraz
rferraz / cometd_client.clj
Created February 5, 2012 06:12
Clojure CometD client example
(ns test.cometd-client
(:import (org.cometd.bayeux.client ClientSessionChannel$MessageListener)
(org.cometd.client BayeuxClient BayeuxClient$State)
(org.cometd.client.transport ClientTransport LongPollingTransport)
(org.eclipse.jetty.client HttpClient)))
(def channel-name "/my-channel")
(def client-url "http://localhost:8080/cometd")
@joefiorini
joefiorini / rails.nix
Created September 18, 2014 06:16
Nix Expression for Running Rails Apps
with (import <nixpkgs> {});
stdenv.mkDerivation {
name = "717-app";
buildInputs = [ libiconv openssl ruby21 postgresql git nodejs ];
src = "/src/717";
builder = builtins.toFile "builder.sh" ''
set -e
source $stdenv/setup
@idris
idris / lesswatch.js
Created July 13, 2011 14:37
lesswatch command that can be run to watch a directory and compile .less files to .css files when they are modified.
#!/usr/bin/env node
var fs = require('fs');
var exec = require('child_process').exec;
/*
* lesswatch usage:
*
* `lesswatch` to watch the current directory
@slashdotdash
slashdotdash / article.ex
Last active August 15, 2018 12:37
Commanded multi-entity aggregates
defmodule Article do
defstruct [:content, comments: []]
# public commands
def execute(%Article{}, %PublishArticle{content: content}) do
%ArticlePublished{content: content}
end
def execute(%Article{}, %CommentOnArticle{} = comment) do
type queryBuilder;
type t = (. string) => queryBuilder;
type querySql('options) = {
.
"method": string,
"options": 'options,
"bindings": array(string),
"sql": string,