Skip to content

Instantly share code, notes, and snippets.

@kofno
kofno / *stdout*
Created February 14, 2014 19:27
Texplay install fail; Ruby 2.1; Mavericks
/Users/ryan/.rubies/ruby-2.1.0/bin/ruby extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling actions.c
In file included from actions.c:1:
texplay.h:41: error: ‘sync’ redeclared as different kind of symbol
/usr/include/unistd.h:596: error: previous declaration of ‘sync’ was here
$(function(){
$.ajaxPrefilter(function(o, options){
options.headers = { 'X-CSRF-Token': '#{form_authenticity_token.to_s}' }
});
});
$(function () {
window.swaggerUi = new SwaggerUi({
url: "http://#{request.host}:#{request.port}/api/swagger_doc.json",
apiKey:"",
% irb
irb(main):001:0> require 'opal'
=> true
irb(main):002:0> Opal.use_gem 'prawn'
=> ["/Users/ryan/.gem/ruby/2.0.0/gems/opal-0.6.2/opal", "/Users/ryan/.gem/ruby/2.0.0/gems/opal-0.6.2/stdlib", "/Users/ryan/.gem/ruby/2.0.0/gems/opal-0.6.2/lib", "/Users/ryan/.gem/ruby/2.0.0/gems/ttfunk-1.1.1/lib", "/Users/ryan/.gem/ruby/2.0.0/gems/pdf-core-0.2.5/lib", "/Users/ryan/.gem/ruby/2.0.0/gems/prawn-1.0.0/lib"]
irb(main):003:0> Opal.process 'prawn'
RegexpError: invalid multibyte escape: /[\x00-\x19\x80-\xff]/
from /Users/ryan/.gem/ruby/2.0.0/gems/opal-0.6.2/lib/opal/nodes/literal.rb:53:in `initialize'
from /Users/ryan/.gem/ruby/2.0.0/gems/opal-0.6.2/lib/opal/nodes/literal.rb:53:in `new'
from /Users/ryan/.gem/ruby/2.0.0/gems/opal-0.6.2/lib/opal/nodes/literal.rb:53:in `compile'
@kofno
kofno / broken-bundle.js
Created August 30, 2014 13:07
Different bundles generated by watchify if components npm link-ed rather then npm-install-ed
This file has been truncated, but you can view the full file.
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"/Users/ryan/src/javascript/date-rangeinator/demo.js":[function(require,module,exports){
var React = require('react')
, TimePicker = require('time-pikinator')
, div = React.DOM.div
, moment = require('moment')
;
var App = React.createClass({
getInitialState: function() {
var theDate = new Date();
@kofno
kofno / *eshell*
Created November 25, 2014 13:42
Chruby in eshell vs. chruby on zsh.
~/Projects/exec_online $ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 2.2.2
- RUBY VERSION: 2.1.3 (2014-09-19 patchlevel 242) [x86_64-darwin14.0]
- INSTALLATION DIRECTORY: /Users/ryan/.gem/ruby/2.0.0
- RUBY EXECUTABLE: /Users/ryan/.rubies/ruby-2.1.3/bin/ruby
- EXECUTABLE DIRECTORY: /Users/ryan/.gem/ruby/2.0.0/bin
- SPEC CACHE DIRECTORY: /Users/ryan/.gem/specs
- RUBYGEMS PLATFORMS:
- ruby
@kofno
kofno / *stdout*
Created November 26, 2014 14:23
SAD PANDA
cabal: Error: some packages failed to install:
ghc-mod-5.2.1.1 depends on haskell-src-exts-1.16.0.1 which failed to install.
haskell-src-exts-1.16.0.1 failed during the configure step. The exception was:
ExitFailure 1
hlint-1.9.12 depends on haskell-src-exts-1.16.0.1 which failed to install.
@kofno
kofno / init.el
Last active August 29, 2015 14:11
Here's how I had to fix hippie expand to work w/ paredit-mode. The example in emacswiki wasn't working for me.
;; Hippie expand fix for paredit
(defun kofno/he-paredit-fix (str &optional trans-case)
"remove extra paren when expanding line in paredit"
(if (and paredit-mode (equal (substring str -1) ")"))
(progn (backward-delete-char 1) (forward-char))))
(advice-add 'he-substitute-string :after 'kofno/he-paredit-fix)
@kofno
kofno / init.el
Last active August 29, 2015 14:11
Colorize your process buffers with a custom process filter
(defun kofno/ansi-color-proc-filter (proc string)
(when (buffer-live-p (process-buffer proc))
(with-current-buffer (process-buffer proc)
(let ((moving (= (point) (process-mark proc))))
(save-excursion
;; Insert the text, advancing the process marker.
(goto-char (process-mark proc))
(insert string)
(ansi-color-apply-on-region (point-min) (point-max))
(set-marker (process-mark proc) (point)))
@kofno
kofno / gist:e5a1f385b4ed38562a39
Created February 4, 2015 19:30
Halcyon tutorial install error
-----> Examining cache contents
halcyon-cabal-1.20.0.3-hackage-2015-02-04.tar.gz
halcyon-ghc-7.8.3.tar.gz
-----> Cloning https://github.com/mietek/halcyon-tutorial... done, f1ccdd9
-----> Installing halcyon-tutorial-1.0
Label: halcyon-tutorial-1.0
Prefix: /app
Source hash: b90bb47
External storage: public
@kofno
kofno / new.js.erb
Created May 22, 2015 03:11
Simple js partial example.
$('#the-modal').html('<%=j render('form') %>')
$('#the-modal').modal('show')