Skip to content

Instantly share code, notes, and snippets.

View trak3r's full-sized avatar

Thomas "Teflon Ted" Davis trak3r

View GitHub Profile
require "net/http"
# Example Usage:
#
# use Rack::Proxy do |req|
# if req.path =~ %r{^/remote/service.php$}
# URI.parse("http://remote-service-provider.com/service-end-point.php?#{req.query}")
# end
# end
#
this works:
%script= raw render 'show.js.coffee'
but it throws this warning:
DEPRECATION WARNING: Passing the format in the template name is deprecated. Please pass render with :formats => [:js] instead.
--
#!/bin/bash
MINUTES=10
#
# this script pulls the last $MINUTES minutes out of the apache logs
# so cron it to run every $MINUTES minutes
#
SERVER_ALIAS=$(hostname -s)
NAMESPACE="Apache"
METRIC_NAME="RequestsPerMinute"
<!DOCTYPE html>
<html>
<head>
<title>xxx</title>
<link href="/assets/bootstrap.css" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/bootstrap-responsive.css" media="all" rel="stylesheet" type="text/css" />
<script src="/assets/jquery-1.8.2.js" type="text/javascript"></script>
<script src="/assets/bootstrap.js" type="text/javascript"></script>
</head>
<body>
@trak3r
trak3r / gist:3390368
Created August 18, 2012 23:37 — forked from tankchintan/gist:1335220
Procedure for installing and setting Sun JDK Java on Default Amazon Linux AMI
# Get the latest Sun Java SDK from Oracle http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u1-download-513651.html
wget http://download.oracle.com/otn-pub/java/jdk/7u1-b08/jdk-7u1-linux-i586.rpm
# Rename the file downloaded, just to be nice
mv jdk-7u1-linux-i586.rpm\?e\=1320265424\&h\=916f87354faed15fe652d9f76d64c844 jdk-7u1-linux-i586.rpm
# Install Java
sudo rpm -i jdk-7u1-linux-i586.rpm
# Check if the default java version is set to sun jdk
ruby-1.9.2-p0 :001 > nested_arrays = [[1,2,3],4,5,6]
=> [[1, 2, 3], 4, 5, 6]
ruby-1.9.2-p0 :002 > x = nested_arrays.first.first
=> 1
ruby-1.9.2-p0 :003 > x
=> 1
ruby-1.9.2-p0 :004 > (z,), = nested_arrays
=> [[1, 2, 3], 4, 5, 6]
ruby-1.9.2-p0 :005 > z
=> 1
»brew outdated
ack (1.94 < 1.96)
cassandra (1.1.1 < 1.1.2)
gettext (0.17 < 0.18.1.1)
glib (2.24.2 < 2.32.4)
gnutls (2.10.2 < 2.12.20)
imagemagick (6.6.4-5, 6.7.1-1 < 6.7.7-6)
jpeg (8b, 8c < 8d)
libevent (1.4.14b < 2.0.19)
libgcrypt (1.4.6 < 1.5.0)
#!/usr/bin/ruby
# Copyright 2007 Amazon Technologies, Inc. Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy of the License at:
#
# http://aws.amazon.com/apache2.0
#
# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and limitations under the License.
@trak3r
trak3r / filters_view.js.coffee
Created March 5, 2012 17:23 — forked from kwhitaker/filters_view.js.coffee
Trying to scope back to currentView
class window.PlacementFiltersView extends Backbone.View
el: "#placements form#filters"
initialize: ->
currentView = @
# Create a hash of labels for the filter type-aheads
@filterLabels = []
jQuery(@el).find('.filter-top-level option').each ->
if jQuery(@).val() isnt ''
# saves are queued on a per-model-instance (aka "cid") basis...
Backbone.Model.prototype.saveWithoutQueue = Backbone.Model.prototype.save
Backbone.Model.prototype.save = (key, value, options) ->
if _.isObject(key) or not key? # flip 'em
options = value
value = null
options = (if options then _.clone(options) else {})