This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | |
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
»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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 {}) |