Skip to content

Instantly share code, notes, and snippets.

View danott's full-sized avatar
📈
Chart with upward trend

Dan Ott danott

📈
Chart with upward trend
View GitHub Profile
var stripAnsi = require('strip-ansi');
var RequestShortener = require('webpack/lib/RequestShortener');
var requestShortener = new RequestShortener(process.cwd());
function formatError(e) {
var showErrorDetails = true;
var text = '';
if (typeof e === 'string') {
e = {
message: e,
<!--
#####################################
TITLE: Daily Events Detailed Report
#####################################
DESCRIPTION: This reports all the events happening on a day (or span of days) and contains more detailed information (such as answers to questions attached to rooms). The visual style is more appropriate for displaying as a web page.
-->
<!DOCTYPE html>
<html>
<head>
.highlight {
background-color: #efefef;
padding: 7px 7px 7px 10px;
border: 1px solid #ddd;
-moz-box-shadow: 3px 3px rgba(0,0,0,0.1);
-webkit-box-shadow: 3px 3px rgba(0,0,0,0.1);
box-shadow: 3px 3px rgba(0,0,0,0.1);
margin: 20px 0 20px 0;
overflow: hidden;
<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
</IfModule>
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
</IfModule>
Options +FollowSymLinks +ExecCGI
RewriteEngine On
@danott
danott / hack.sh
Created May 4, 2012 16:35 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@danott
danott / facebook-tinymce.js
Created March 7, 2012 21:34 — forked from cheeaun/facebook-tinymce.js
Facebook's TinyMCE code
function MceEditor() {}
MceEditor.prototype = {
init: function (b, c) {
this.canvasId = b.id;
this.settings = c;
var a = c.plugins;
if (a && a.search('AtD') !== -1) this.settings.atd_rpc_id = $('post_form_id').value;
if (this.is_visible || !this.settings.delay_initialization) this.startEditor();
},
startEditor: function () {
@danott
danott / rdebug-pow.rb
Created February 7, 2012 18:12 — forked from jkronz/rdebug-pow.rb
rdebug using pow
# config/initializers/danott_custom.rb
# connect using rdebug -c
if (Rails.env.development? || Rails.env.test?) && !$rails_rake_task
require 'ruby-debug'
Debugger.settings[:autoeval] = true
Debugger.settings[:autolist] = 1
Debugger.settings[:reload_source_on_change] = true
Debugger.start_remote
end
@danott
danott / pow_port.rb
Created May 31, 2011 20:48 — forked from dhrrgn/pow_port.rb
Quickly and easily change the port that Pow is running on. This allows you too run Apache and Pow side-by-side (on different ports of course).
#!/usr/bin/env ruby
# Pow Port
#
# Quickly and easily change the port that Pow is running on. This allows
# you too run Apache and Pow side-by-side (on different ports of course).
#
# WARNING: This will OVERWRITE your ~/.powconfig file. If you have custom
# configurations in there, please back it up first.
#
@danott
danott / install_pow_with_apache_proxy.sh
Created May 31, 2011 20:48 — forked from jwilger/install_pow_with_apache_proxy.sh
Run this file to instal 37signals' Pow but use an Apache proxy instead of the firewall rule.
curl get.pow.cx/install.sh | sh
# We don't actually want the firewall rule that pow installs
echo "Get rid of those silly firewall rules for port 80."
ports=($(ruby -e'puts $<.read.scan(/fwd .*?,([\d]+).*?dst-port ([\d]+)/)' "/Library/LaunchDaemons/cx.pow.firewall.plist"))
HTTP_PORT=${ports[0]}
DST_PORT=${ports[1]}
RULE=$(sudo ipfw show | (grep ",$HTTP_PORT .* dst-port $DST_PORT in" || true) | cut -f 1 -d " ")
[[ -n "$RULE" ]] && sudo ipfw del "$RULE"
# Unload the firewall plist and remove it.
@danott
danott / simple_args_parsing.sh
Created March 4, 2011 16:59 — forked from jehiah/simple_args_parsing.sh
Simple bash shell arg parsing
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"