Skip to content

Instantly share code, notes, and snippets.

View richmolj's full-sized avatar

Lee Richmond richmolj

View GitHub Profile
var api = new UpvtIframeApi('#upvt-iframe');
function slugify (str) {
var slugged = str.replace(/^\s+|\s+$/g, '');
slugged = slugged.toLowerCase()
return slugged.replace(/[^a-z0-9 -]/g, '')
.replace(/\s+/g, '-')
.replace(/-+/g, '-')
}
@richmolj
richmolj / gist:9199292
Last active August 29, 2015 13:56
Matchup div example
api.events.onMatchupView = function(matchup) {
//https://groups.google.com/forum/#!topic/disqus-dev/hi8mm5DtN-s
var id = "seed-"+matchup.contestants[0].seed+"-"+matchup.contestants[1].seed+""
DISQUS.reset({
reload: true,
config: function () {
this.page.identifier = id;
this.page.url = window.location.href + "/#!/" + id;
}
Lees-MacBook-Pro:code leerichmond$ export EXECJS_RUNTIME='Node'
irb(main):001:0> require 'execjs'
ExecJS::RuntimeUnavailable: Node.js (V8) runtime is not available on this system
from /Users/leerichmond/rubinius/gems/1.9/gems/execjs-1.4.0/lib/execjs/runtimes.rb:65:in `from_environment'
from /Users/leerichmond/rubinius/gems/1.9/gems/execjs-1.4.0/lib/execjs/runtimes.rb:50:in `autodetect'
from /Users/leerichmond/rubinius/gems/1.9/gems/execjs-1.4.0/lib/execjs.rb:5:in `__script__'
from /Users/leerichmond/rubinius/gems/1.9/gems/execjs-1.4.0/lib/execjs.rb:4:in `__script__'
from kernel/common/codeloader.rb:232:in `require'
from kernel/common/kernel.rb:638:in `gem_original_require (require)'
from /Users/leerichmond/rubinius/lib/rubygems/custom_require.rb:60:in `require'
__CF_USER_TEXT_ENCODING=0x1A1D6313:0:0
NLS_LANG=AMERICAN_AMERICA.UTF8
richmolj ~/code/rubinius $ ./configure
Checking gcc: found
Checking g++: found
Checking bison: found
Configuring LLVM...
Checking for existing LLVM library tree: found!
Checking sizeof(short): 2 bytes
Checking sizeof(int): 4 bytes
Checking sizeof(void*): 8 bytes
TERM_PROGRAM=Apple_Terminal
SHELL=/bin/bash
TERM=xterm-256color
TMPDIR=/var/folders/4l/l3fq04bj5y3c60w9sl6n49_m0000gn/T/
Apple_PubSub_Socket_Render=/tmp/launch-i55QGh/Render
TERM_PROGRAM_VERSION=309
TERM_SESSION_ID=46A34ACF-35FA-49A7-98DD-FD955724F795
USER=richmolj
COMMAND_MODE=unix2003
SSH_AUTH_SOCK=/tmp/launch-6Gh463/Listeners
module Rubinius
# Make this reload friendly without silly constant defined warnings.
BUILD_CONFIG = {
:command_line => "",
:which_ruby => :ruby,
:build_ruby => "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby",
:build_rake => "rake",
:build_perl => "perl",
:llvm => :prebuilt,
:llvm_configure => "/Users/richmolj/code/rubinius/vendor/llvm/Release/bin/llvm-config",
Building 18/pty
make
compiling pty.c
pty.c:1:20: error: config.h: No such file or directory
In file included from pty.c:26:
/Users/richmolj/code/rubinius/vm/capi/19/include/ruby/backward/rubyio.h:1:2: warning: #warning use "ruby/io.h" instead of "rubyio.h"
In file included from pty.c:27:
/Users/richmolj/code/rubinius/vm/capi/19/include/ruby/backward/util.h:1:2: warning: #warning use "ruby/util.h" instead of bare "util.h"
make: *** [pty.o] Error 1
rake aborted!
creating Makefile
make
compiling pty.c
pty.c:1:20: error: config.h: No such file or directory
In file included from pty.c:26:
/Users/richmolj/code/rubinius/vm/capi/19/include/ruby/backward/rubyio.h:1:2: warning: #warning use "ruby/io.h" instead of "rubyio.h"
In file included from pty.c:27:
/Users/richmolj/code/rubinius/vm/capi/19/include/ruby/backward/util.h:1:2: warning: #warning use "ruby/util.h" instead of bare "util.h"
make: *** [pty.o] Error 1
rake aborted!
kernel/common/encoding.rb:139:in `initialize'
kernel/common/io19.rb:153:in `read_encode'
kernel/common/io19.rb:687:in `read'
execjs (1.4.0) lib/execjs/external_runtime.rb:173:in `sh'
kernel/common/io19.rb:1155:in `popen'
execjs (1.4.0) lib/execjs/external_runtime.rb:173:in `sh'
execjs (1.4.0) lib/execjs/external_runtime.rb:138:in `exec_runtime'
execjs (1.4.0) lib/execjs/external_runtime.rb:28:in `exec'
execjs (1.4.0) lib/execjs/external_runtime.rb:41:in `compile_to_tempfile'
execjs (1.4.0) lib/execjs/external_runtime.rb:27:in `exec'