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
/* LexitronCreateAxes.cs | |
* | |
* 1. Place this script in your project's Assets/Editor/ directory. | |
* 2. Open Edit -> Project Settings -> Input and verify that there are four "Lexitron" axes. | |
* 3. Delete this script. | |
* | |
* All of this code shamelessly swiped from: | |
* http://www.plyoung.com/blog/manipulating-input-manager-in-script.html | |
* http://answers.unity3d.com/questions/26994/running-a-script-when-unity-starts.html | |
*/ |
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
/* | |
gulpfile.js | |
Gulp lacks a native way to provide task documentation or break tasks | |
into multiple files. This gulpfile reads './tasks/*.js' and can list | |
all available tasks with `gulp` or `gulp tasks`. If you set a .desc | |
property on your task functions, those descriptions will show up in | |
`gulp tasks` output. Tasks without descriptions will be omitted | |
from this output (but still visible with `gulp -T`). | |
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 File.expand_path("../init", __FILE__) | |
require 'rack/ssl-enforcer' | |
# Require HTTPS for all requests (not required; remove if unavailable) | |
use Rack::SslEnforcer | |
AUTH_CREDS = { user: 'user', pass: 'password' } | |
# Create a middleware to add HTTP basic auth to all but the whitelisted paths | |
class ProtectedApp |
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
DASH | |
---- | |
Not actually supported by POSIX alone. Googled from http://www.spinics.net/lists/dash/msg00327.html: | |
$ exec 3>&1 # duplicate original stdout | |
$ result=$( | |
exec 4>&1 >&3 3>&- # move cmd subst stdout, and restore original | |
{ ./main.sh; echo $? >&4 # run command, and record its status | |
} | head -n 3) | |
$ echo $result # status from ./main.sh |
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
# Adds left joins to ActiveRecord. | |
# | |
# = Description | |
# | |
# This patch adds a #left_joins method to ActiveRecord models and relations. It | |
# works like #joins, but performs a LEFT JOIN instead of an INNER JOIN. | |
# | |
# = A warning about +count+ | |
# | |
# When using with #count, ActiveRecord 3.2.8 is hard-coded to act as if |
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
# Collection of helpers for math-related ARel NamedFunctions. | |
# | |
# Include this in classes that need to do trig with DB functions. Lets you write | |
# cleaner code, like: | |
# | |
# dist = acos(sin(lat) * sin(arel_lat_field) + | |
# cos(lat) * cos(arel_lat_field) * cos(arel_lng_field)) * EARTH_RADIUS_KM | |
# band_num = round(dist / ring_width, 0) | |
# band_num.to_sql | |
# # => round(abs(acos( |
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
// Heartbeat log script for node.js. Use this to sniff out code that blocks | |
// your event loop; heartbeats will take longer if the event loop is | |
// blocked. | |
// Just require('./heartbeat.js'); ==OR== require('./heartbeat.js')(3000); | |
module.exports = go; | |
var DEFAULT_HEARTBEAT_MS = 2000; | |
var startedAt, loop; | |
go(); |
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
/* | |
setup_teardown_helper.js | |
Setup and teardown helper functions for jasmine-node (jasmine 1.3). | |
IMNSHO, every damn test runner should provide the following hooks: | |
startup (global; runs once before any setups or specs begin) | |
setup (describe-local; runs once before any specs in a `describe`) | |
beforeEach (describe-local; runs once before each spec in a `describe`) | |
afterEach (describe-local; runs once after each spec in a `describe`) |
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
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
/* Google Analytics integration. Web page must be configured for GA with Google's javascript snippet. | |
* | |
* Based on a comment from 2010 found here: | |
* http://blog.mostlytigerproof.com/2009/10/06/gathering-statistics-using-google-analytics-and-unity-3d/ | |
* | |
* Analytics category/action/label/value descriptions: |
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/env ruby | |
# | |
# haters.rb | |
# | |
# Finds all the Twitter users posted to http://gamerfury.tumblr.com and prints | |
# them, newline-delimited, to STDOUT. Require this file in your own script to | |
# access ScumbagHaterFinder directly. | |
# | |
# Tested with Ruby 2.0.0. |
OlderNewer