Skip to content

Instantly share code, notes, and snippets.

Avatar

D.H. Clapp dhc02

View GitHub Profile
View jquery.drop.js
(function($){
function dragEnter(e) {
$(e.target).addClass("dragOver");
e.stopPropagation();
e.preventDefault();
return false;
};
function dragOver(e) {
e.originalEvent.dataTransfer.dropEffect = "copy";
View jquery.insert.js
(function($){
var insertAtCaret = function(value) {
if (document.selection) { // IE
this.focus();
sel = document.selection.createRange();
sel.text = value;
this.focus();
}
else if (this.selectionStart || this.selectionStart == '0') {
var startPos = this.selectionStart;
@dhc02
dhc02 / ThinkUp on EC2 Ubuntu 10.10 User-Data Script
Created Apr 22, 2011 — forked from waxpancake/ThinkUp on EC2 Ubuntu User-Data Script
Install script for non-interactively installing ThinkUp and prerequisites
View ThinkUp on EC2 Ubuntu 10.10 User-Data Script
#!/bin/bash -ex
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
# install ThinkUp on EC2 Ubuntu instance:
#
# @spara 12/23/10
# @waxpancake 1/3/11
# install required packages
sudo apt-get update