Skip to content

Instantly share code, notes, and snippets.

View thrashr888's full-sized avatar
🐮
moo

Paul Thrasher thrashr888

🐮
moo
View GitHub Profile
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://gist.github.com/thrashr888/6047603/raw/6584ab9c5d500613303c852d79d619690b835305/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
/*jslint browser: true*/
/*global require*/
require.config({
shim: {
'underscore': {
exports: '_'
},
'backbone': {
// Depends on underscore/lodash and jQuery

Boys Names

  • Buster
  • Stryker
  • Ford
  • Diesel
  • Felix
  • Xavier
  • Tim
  • Thom
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
// this identifies your website in the createToken call below
{% if article._published|date('n') >= 10 %}
{% set quarter = article._published|date('Y')~'Q4' %}
{% elseif article._published|date('n') >= 7 %}
{% set quarter = article._published|date('Y')~'Q3' %}
{% elseif article._published|date('n') >= 4 %}
{% set quarter = article._published|date('Y')~'Q2' %}
{% elseif article._published|date('n') >=1 %}
{% set quarter = article._published|date('Y')~'Q1' %}
{% endif %}
import sys, time, subprocess, socket, telnetlib
from datetime import datetime
from collections import defaultdict
from boto.ec2.cloudwatch import CloudWatchConnection
MAPPINGS = {
# Memcached name: (AWS Name, AWS Metric Type, Calculation Method)
'uptime': ('Uptime', 'Count', 'gauge'),
@thrashr888
thrashr888 / gist:3880933
Created October 12, 2012 19:15
the most amazing javascript code i've ever written
<script>
var docwritebuffer = "";
document.wrong = document.write;
document.write = function(html){
docwritebuffer = html;
}
</script>
<script type="text/javascript" src="http://myforum.disqus.com/popular_threads_widget.js?num_items=5"></script>
<script>
document.write = document.wrong;
@thrashr888
thrashr888 / flask_geventwebsocket_example.py
Created October 12, 2012 03:48 — forked from lrvick/flask_geventwebsocket_example.py
Simple Websocket echo client/server with Flask and gevent / gevent-websocket
from geventwebsocket.handler import WebSocketHandler
from gevent.pywsgi import WSGIServer
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@thrashr888
thrashr888 / s3copy
Created October 2, 2012 08:31
s3copy copies files and streams to a public S3 file and copies the url to your clipboard.
#!/usr/local/bin/php
<?php
error_reporting(-1);
define('CFRUNTIME_NAME', 'aws-sdk-php');
define('CFRUNTIME_VERSION', 'Panther');
define('CFRUNTIME_BUILD', '20120926163000');
define('CFRUNTIME_USERAGENT', CFRUNTIME_NAME . '/' . CFRUNTIME_VERSION . ' PHP/' . PHP_VERSION . ' ' . str_replace(' ', '_', php_uname('s')) . '/' . str_replace(' ', '_', php_uname('r')) . ' Arch/' . php_uname('m') . ' SAPI/' . php_sapi_name() . ' Integer/' . PHP_INT_MAX . ' Build/' . CFRUNTIME_BUILD . __aws_sdk_ua_callback());
@thrashr888
thrashr888 / dabblet.css
Created August 1, 2012 22:29 — forked from dstorey/dabblet.css
set the size of the boxes and any decoration
.slider {
/* set initial width */
width: 520px;
/* hide the content that overflows (to allow second box to show through) */
overflow: hidden;
display: inline-block;
/* skew container so that it has angled edge, and set up transition */
transform: skewX(-20deg);