Skip to content

Instantly share code, notes, and snippets.

View thomasboyt's full-sized avatar

Thomas Boyt thomasboyt

View GitHub Profile
(defproject async-tut1 "0.1.0-SNAPSHOT"
:description "FIXME: write this!"
:url "http://example.com/FIXME"
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/clojurescript "0.0-2080"]]
:plugins [[lein-cljsbuild "1.0.0"]]
:source-paths ["src"]
@thomasboyt
thomasboyt / docs.md
Created December 21, 2013 17:43
clojure docs are weird

Some Clojure docs:

  • "Getting started" is a completely useless page. "You can either download/unzip (which no one should ever do) or use Lein (which we won't tell you how to use!)."
  • API docs are exactly what they say on the tin. Only auto-generated from source. Usually lack examples and further explanations.
  • Reference documentation - a mix of guides and very short pages introducing features. Usefulness varies.
  • Cheat sheet - symbol index that is really useful. Pages are a mix of links to clojuredocs and to the API reference.
  • Clojuredocs - community resource. Out of date. Users can add examples or comments, but the docs themselves still come from the source docstrings, making them rather redundant.
  • clojure-doc.org - a bit confusingly named, but very exciting. Uses pull requests for docs contributions, an

Given this:

var MyForm = React.createClass({
  mixins: [FormMixin],
  render: function() {
    return (
      <fieldset className="inputs">
        <div class="form-row clearfix">
 
pid-29185 thread-4416045056 (Thread-1) Traceback (most recent call last):
pid-29185 thread-4416045056 (Thread-1) File "/Users/thomasboyt/Code/www.gittip.com/configure-aspen.py", line 58, in update_homepage_queries
pid-29185 thread-4416045056 (Thread-1) website.db.self_check()
pid-29185 thread-4416045056 (Thread-1) File "/Users/thomasboyt/Code/www.gittip.com/gittip/models/__init__.py", line 17, in self_check
pid-29185 thread-4416045056 (Thread-1) self._check_balances()
pid-29185 thread-4416045056 (Thread-1) File "/Users/thomasboyt/Code/www.gittip.com/gittip/models/__init__.py", line 88, in _check_balances
pid-29185 thread-4416045056 (Thread-1) assert b == 0, "conflicting balances: {}".format(b)
pid-29185 thread-4416045056 (Thread-1) AssertionError: conflicting balances: 100
pid-30434 thread-4535521280 (CP Server Thread-2) None
pid-30434 thread-4535521280 (CP Server Thread-2) Cannot import pygments: No module named pygments.lexers
pid-30434 thread-4535521280 (CP Server Thread-2) 500 Internal Server Error /thomasboyt/ ...en/www/error.html.spt
pid-30434 thread-4535521280 (CP Server Thread-2) 200 OK /favicon.ico ./favicon.ico

https://github.com/thomasboyt/slack-slash-venmo/commit/9901a1bae3f96a80fc221f323bcd1cc9fe9f8337

In the above diff, you can see that all I really did, logically, was removed lines 39 and 40. However, because of Clojure's formatting rules, the closing paren of the function was appended to line 38, which Git considers a new line of code.

This seems like it could make tools like git blame and git diff harder to use, as you'd end up with cases where a line didn't actually change other than having a closing brace appended or removed from it.

@thomasboyt
thomasboyt / requirejs_grunt_config.js
Created January 31, 2014 18:54
requirejs sadness
var _ = require('underscore');
var baseConfig = {
baseUrl: 'public/',
name: 'js/lib/requirejs/require',
mainConfigFile: 'public/js/main.js',
wrap: true,
// Configuration for jsx plugin to work
useStrict: true,
@thomasboyt
thomasboyt / optimum.md
Last active August 29, 2015 13:56
My Optimum nightmare

Background: after my internet was installed back in July, it had been a bit spotty, but nothing out of the ordinary, up until January, when it became a complete trainwreck. I prodded Optimum Support on Twitter to get me appointments, since their phone system is a nightmare.

Appointment 1

Jan 10:

Me: Hi, my home internet connection has been completely down for the past few days and I was told to send my account info here

Me: Not sure exactly what I need to send - it's registered under "Thomas Boyt," number XXX-XXX-XXXX, zip code XXXX >

@thomasboyt
thomasboyt / grunt.js
Created February 10, 2014 23:44
Side-by-side comparison of Grunt and Gulp configuration. Only significant difference is that `gulp-concat` doesn't generate source maps like `grunt-concat-sourcemaps`.
/* jshint node: true */
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
transpile: {
main: {
type: 'amd',
moduleName: function(path) {

Let's say I have a Bower package called my-less. It depends on a LESS package called lesshat.

my-less's structre is this:

my-less/
  bower_components/   <- not checked in
    lesshat/
      lesshat.less
 main.less