Skip to content

Instantly share code, notes, and snippets.

Deferred reference validation

technomancy, from technomancy/slamhound#19:

“I’ve thought a bit about trying to walk all defmacro bodies in the namespace and check for symbols with a namespace, but that would almost positively result in false positives.”

“I’d rather not handle this than handle this in a way that would have edge cases which could make it go looking for vars that don’t exist.”

@guns
guns / ggs.clj
Created October 13, 2013 09:36
John Korpi's Golden Grid System, rewritten in Garden. This is just a first draft, and excludes the CSS reset and normalizations. Garden: https://github.com/noprompt/garden/
(ns com.metablu.www.ggs
"Joni Korpi's Golden Grid System.
http://goldengridsystem.com/"
(:require [garden.def :refer [defstyles]]
[garden.stylesheet :refer [at-media]]
[garden.units :refer [em percent percent*]]))
(def line 24.0)
(def column (percent (/ 100.0 18.0)))
(def font-size 16.0)
@guns
guns / ffmpeg2.0.patch
Created August 27, 2013 03:35
Patch for cinelerra-cv ffmpeg2.0.patch
diff --git a/cinelerra/ffmpeg.C b/cinelerra/ffmpeg.C
index 6ab6047..f1cd308 100644
--- a/cinelerra/ffmpeg.C
+++ b/cinelerra/ffmpeg.C
@@ -33,9 +33,9 @@ int FFMPEG::init(char *codec_string) {
return 1;
}
- context = avcodec_alloc_context();
+ context = avcodec_alloc_context3(codec);
@guns
guns / clojure-slam-hound.vim
Created August 3, 2013 01:47
Example function and mapping for running slamhound on the current file
" Require fireplace.vim
function! s:ClojureSlamHound(file)
if &modified
echom "Buffer contains unsaved changes!"
return 1
endif
call fireplace#session_eval(
\ '(clojure.core/require (quote slam.hound) (quote clojure.pprint))'
\ . '(let [file (clojure.java.io/file "' . a:file . '")]'
\ . ' (binding [clojure.pprint/*print-right-margin* ' . &textwidth . ']'
@guns
guns / block-char-props.new
Last active December 20, 2015 13:09
vim NFA dumps
This file has been truncated, but you can view the full file.
Regexp: "\v\\[pP]\{\c%(In|blk\=|block\=)%(c%(jk%(_%(unified_ideographs%(_extension_%(a|b|c|d))?|compatibility%(_%(ideographs%(_supplement)?|forms))?|s%(trokes|ymbols_and_punctuation)|radicals_supplement)| %(unified ideographs%( extension %(a|b|c|d))?|compatibility%( %(ideographs%( supplement)?|forms))?|s%(ymbols and punctuation|trokes)|radicals supplement)|unifiedideographs%(extension%(a|b|c|d))?|compatibility%(%(ideographs%(supplement)?|forms))?|s%(trokes|ymbolsandpunctuation)|radicalssupplement)|o%(m%(bining%( %(diacritical marks%( %(for symbols|supplement))?|marks for symbols|half marks)|_%(diacritical_marks%(_supplement)?|marks_for_symbols|half_marks)|diacriticalmarks%(%(supplement|forsymbols))?|halfmarks|marksforsymbols)|mon%(_indic_number_forms| indic number forms|indicnumberforms))|unting%(rodnumerals|_rod_numerals| rod numerals)|ntrol%(pictures|_pictures| pictures)|ptic)|y%(rillic%(%( %(extended-%(a|b)|supplement%(ary)?)|_%(extended_%(a|b)|supplementary)|supplement%(ary)?|extended-%(a|b)))?|priot%(syl
@guns
guns / gist:5156348
Last active December 14, 2015 22:09

Let me start by saying that this is really amazing work. I was genuinely hoping somebody with an iron will and expert regexp chops would step up to the plate and fill out the clojureRegexp matches. And here you are.

This is pretty sweet. Creating this test suite is nothing short of brilliant. Right off the bat I was able to fix two problems (just pushed the fixes). Nice work!

At first I thought that testing Vim syntax was going to be slow (many shellouts to vim) or complicated (using clientserver interface to talk to a vim server), but once I realized that we had macros available, a simple design just fell out.

It would still be faster to talk to a running vim server, but that seems like a lot of complexity for a relatively small speedup.

Ignoring >

@guns
guns / ffmpeg-blurry-text.png
Last active December 10, 2015 00:19
ffmpeg blurry bold / blue / violet text
ffmpeg-blurry-text.png
@guns
guns / lein-vs-jvm-classpath.diff
Created December 17, 2012 05:29
Diff of paths returned by `lein classpath` and directly from a running JVM.
--- lein-classpath.txt 2012-12-16 23:26:03.481915466 -0600
+++ jvm-classpath.txt 2012-12-16 23:26:03.481915466 -0600
@@ -1,4 +1,6 @@
+/home/guns/.lein/self-installs/leiningen-2.0.0-SNAPSHOT-standalone.jar
/home/guns/.m2/repository/bultitude/bultitude/0.1.7/bultitude-0.1.7.jar
+/home/guns/.m2/repository/cheshire/cheshire/3.1.0/cheshire-3.1.0.jar
/home/guns/.m2/repository/cheshire/cheshire/4.0.0/cheshire-4.0.0.jar
/home/guns/.m2/repository/classlojure/classlojure/0.6.6/classlojure-0.6.6.jar
/home/guns/.m2/repository/clj-http/clj-http/0.4.2/clj-http-0.4.2.jar
@@ -13,6 +15,8 @@
@guns
guns / gist:4281734
Created December 14, 2012 01:25
Example output from (print-cheat-sheet!)
;;; arithmetic.core {{{1
arithmetic.core/operators
arithmetic.core/|
arithmetic.core/÷
arithmetic.core/convert-unary [expr]
arithmetic.core/division? [op]
arithmetic.core/nameof [op]
arithmetic.core/negation? [expr]
arithmetic.core/negative? [expr]
$ ruby --version
ruby 1.9.3p0 (2011-11-08 revision 33661) [x86_64-darwin11.2.0]
$ RUBYOPT=-d bundle exec tork rails
Exception `LoadError' at /opt/ruby/1.9/lib/ruby/site_ruby/1.9.1/rubygems.rb:1243 - cannot load such file -- rubygems/defaults/operating_system
Exception `LoadError' at /opt/ruby/1.9/lib/ruby/site_ruby/1.9.1/rubygems.rb:1252 - cannot load such file -- rubygems/defaults/ruby
Exception `NameError' at /opt/ruby/1.9/lib/ruby/gems/1.9.1/gems/psych-1.2.1/lib/psych/core_ext.rb:16 - method `to_yaml' not defined in Object
Exception `NameError' at /opt/ruby/1.9/lib/ruby/gems/1.9.1/gems/psych-1.2.1/lib/psych/core_ext.rb:29 - method `yaml_as' not defined in Module
Exception `NameError' at /opt/ruby/1.9/lib/ruby/gems/1.9.1/gems/psych-1.2.1/lib/psych/core_ext.rb:37 - method `y' not defined in Kernel
Exception `NameError' at /opt/ruby/1.9/lib/ruby/gems/1.9.1/gems/psych-1.2.1/lib/psych/deprecated.rb:79 - undefined method `to_yaml_properties' for class `Object'