Skip to content

Instantly share code, notes, and snippets.

View thrashr888's full-sized avatar
🐮
moo

Paul Thrasher thrashr888

🐮
moo
View GitHub Profile
// codetest.js
// Given initial state of a minesweeper board
var COLS = 8;
var ROWS = 8;
var DIFFICULTY = 0.2;
var mines = [];
for (var i = 0 ; i < COLS ; ++i){
mines[i] = [];
@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);
@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 / 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 / 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;
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'),
{% 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 %}
<!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

Boys Names

  • Buster
  • Stryker
  • Ford
  • Diesel
  • Felix
  • Xavier
  • Tim
  • Thom
/*jslint browser: true*/
/*global require*/
require.config({
shim: {
'underscore': {
exports: '_'
},
'backbone': {
// Depends on underscore/lodash and jQuery