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
function bridge1Test() | |
{ | |
%obj = new SimObject(); | |
%start = getRealTime(); | |
%count = 0; | |
for (%i=0; %i<1000000; %i++) { | |
%obj.getId(); | |
} | |
%end = getRealTime(); | |
//echo("scriptTest3 result: " @ %count); |
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
// Copyright (C) 2013 James S Urquhart. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to | |
// deal in the Software without restriction, including without limitation the | |
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
// sell copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included in |
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
enableWinConsole(true); | |
setLogMode(2); | |
$fuck = "ERRR"; | |
echo("TEST EXPRESSION" @ (1 + 2) @ $fuck SPC "SPACE"); | |
for (%i=0; %i<10; %i++) | |
{ | |
echo("loop" SPC %i); | |
} |
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
// Moves view to be in line with the keyboard | |
// | |
// keyboardHeight == value returned from UIKeyboardBoundsUserInfoKey key | |
// keyboardControlY == place in view the top of the keyboard should line up with | |
// | |
- (void)moveViewForKeyboardHeight:(float)keyboardHeight controlOffset:(float)keyboardControlY | |
{ | |
// Determine what is "up" | |
CGAffineTransform myTransform = self.transform; | |
CGPoint upAxis = CGPointApplyAffineTransform(CGPointMake(0, 1), myTransform); |
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
//----------------------------------------------------------------------------- | |
// Copyright (c) 2012 GarageGames, LLC | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to | |
// deal in the Software without restriction, including without limitation the | |
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
// sell copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// |
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
// ******** | |
TorqueScript code | |
// ******** | |
$shit = 1; | |
$fudge = 2 + 2.3; | |
if ($fudge < 2) // TOFIX | |
{ |
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
# Detects what server your Rails app is running under. | |
# Either passenger, fastcgi, mongrel, webrick or thin | |
def running_under | |
# For passenger, IN_PHUSION_PASSENGER is key | |
is_passenger = (defined?(IN_PHUSION_PASSENGER) and IN_PHUSION_PASSENGER) | |
# Not sure about fastcgi, but this should do the trick | |
is_fastcgi = (Kernel.const_get('RailsFCGIHandler') if defined?(FCGI)) rescue false | |
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
First things first, Dreamhost can be a complete nightmare, so be prepared to loose your sanity over this. | |
1. I need gem x | |
Follow the instructions at http://wiki.dreamhost.com/index.php/RubyGems to make your own gem installation, then add the following to the top of your config/environment.rb | |
ENV['GEM_PATH'] = "/home/username/.gems:/usr/lib/ruby/gems/1.8" | |
2. Out of date RedCloth | |
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
# Simple script to consolidate multiple colloquy transcripts into a single HTML log | |
# | |
# Reads from logs/*.colloquyTranscript | |
# Outputs to out.html | |
# | |
# Have multiple logs of conversations with a user who uses multiple nicknames | |
# in colloquy, each in separate files? | |
# | |
# Well here is the solution. Now you'll never get confused over which important | |
# piece of information is in which transcript ever again, as it will all be |
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
# Simple script to parse dates of Barcamp events from barcamp.org | |
# | |
# Outputs to barcamp.ics | |
# | |
require 'rubygems' | |
require 'nokogiri' | |
require 'fileutils' | |
require 'date' | |
require 'time' |
OlderNewer