Skip to content

Instantly share code, notes, and snippets.

@CootCraig
CootCraig / drag_drop_sortable.html
Last active August 29, 2015 14:01
Demonstrate drag and drop between ul using JQuery Sortable.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>DragDropDemo</title>
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" />
@CootCraig
CootCraig / gist:3f8edcd17310483febe8
Created December 14, 2014 01:45
Shared for ivie set up
~~~~~~~~~~~~
UUID=59230da6-d4e1-4e4f-95bb-4914b473b3fe / ext4 errors=remount-ro 0 1
/dev/sdb1 /mnt/disk2 ext4 auto 0 1
# swap was on /dev/sda5 during installation
UUID=fbfdf184-9b7a-41b2-97da-24a7fe0f2edd none swap sw 0 0
//10.10.10.111/c$ /media/gcs1c cifs rw,noauto,credentials=/home/craig/gcsww_canderson.txt,uid=craig 0 0
//10.10.10.111/d$ /media/gcs1d cifs rw,noauto,credentials=/home/craig/gcsww_canderson.txt,uid=craig 0 0
//10.10.10.117/f$ /media/gcs3f cifs rw,noauto,credentials=/home/craig/gcsww_canderson.txt,uid=craig 0 0
//10.10.10.117/e$ /media/gcs3e cifs rw,noauto,credentials=/home/craig/gcsww_canderson.txt,uid=craig 0 0
//192.168.88.209/media /media/nas1 cifs rw,noperm,noauto,credentials=/home/craig/nas1_credentials.txt,uid=craig,sec=ntlmv2 0 0
@CootCraig
CootCraig / fail log 1
Created December 20, 2014 17:47
nanoc compile faile on debian
craig@mydeb:~/dev/nanoc_blog/blog$ bundle exec nanoc compile
/var/lib/gems/2.1.0/gems/execjs-2.2.2/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /var/lib/gems/2.1.0/gems/execjs-2.2.2/lib/execjs.rb:5:in `<module:ExecJS>'
from /var/lib/gems/2.1.0/gems/execjs-2.2.2/lib/execjs.rb:4:in `<top (required)>'
from /var/lib/gems/2.1.0/gems/uglifier-2.6.0/lib/uglifier.rb:3:in `require'
from /var/lib/gems/2.1.0/gems/uglifier-2.6.0/lib/uglifier.rb:3:in `<top (required)>'
from /var/lib/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/runtime.rb:76:in `require'
from /var/lib/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /var/lib/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/runtime.rb:72:in `each'
from /var/lib/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/runtime.rb:72:in `block in require'
@CootCraig
CootCraig / console log 1
Created January 5, 2015 20:47
Load server image assets into Snap.svg
index 0 has attr name El_Estudiante_de_la_tuna.jpg
index 0 has attr data-src /img/The_Spaniards_101-El_Estudiante_de_la_tuna.jpg
name El_Estudiante_de_la_tuna.jpg has loaded
@CootCraig
CootCraig / index.html
Created January 22, 2015 20:35
Load a list of svg image with a Q Promise
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
@CootCraig
CootCraig / lightdm X setup
Last active August 29, 2015 14:14
logitech marble mouse setup
# /usr/local/share/lightdm/ivie2.sh
#!/bin/sh
xrandr --output HDMI3 --mode 1280x960 --pos 1280x0 --rotate normal --output HDMI2 --mode 1280x960 --pos 0x0 --rotate normal --output HDMI1 --off --output DP1 --off --output VGA1 --off
xinput --set-button-map "Logitech USB Trackball" 1 9 3 4 5 6 7 8 2
xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation" 8 1
xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation Button" 8 8
xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation Axes" 8 6 7 4 5
@CootCraig
CootCraig / Gemfile.lock
Created August 11, 2015 19:01
2015-08-11 celluloid-zmq load error
GEM
remote: http://rubygems.org/
specs:
addressable (2.3.8)
celluloid (0.17.1.1)
bundler
celluloid-essentials
celluloid-extras
celluloid-fsm
celluloid-pool
@CootCraig
CootCraig / webapp.rb
Created November 17, 2010 23:34 — forked from igrigorik/webapp.rb
require 'rubygems'
require 'rack'
class Object
def webapp
class << self
define_method :call do |env|
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?)
[200, {}, send(func, *attrs)]
end
@CootCraig
CootCraig / ancestors.rb
Created December 4, 2010 22:23
Show the ancestor classes of an object
module TryItOut
class << self
def ancestors(o)
a = []
a << ((o.class == Class) ? o : o.class)
loop {
break if a[-1].nil?
a << a[-1].superclass
}
a
@CootCraig
CootCraig / proc_demo.rb
Created December 31, 2010 17:40
Demo. Proc.new closure. Using call and method block.
# Output
# p1_a.call(1) => proc1 - a - 1
# p1_b.call(2) => proc1 - b - 2
# p2_o.call(3) => proc2 - o - 3
# p2_p.call(4) => proc2 - p - 4
# TestClass.m_block(&p1_a) => method TestClass.m_block yield(100) => proc1 - a - 100
# TestClass.m_block(&p1_b) => method TestClass.m_block yield(101) => proc1 - b - 101
# TestClass.m_block(&p2_o) => method TestClass.m_block yield(102) => proc2 - o - 102
# TestClass.m_block(&p2_p) => method TestClass.m_block yield(103) => proc2 - p - 103