This file contains hidden or 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
@interface SomeSingleton { | |
uint8_t * someBlockOfMemory; | |
} | |
@property(readwrite, atomic, assign) uint8_t * someBlockOfMemory; | |
+(id) sharedInstnace; | |
@end |
This file contains hidden or 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
-(void)setupView:(GLView*)view | |
{ | |
const GLfloat zNear = -0.01, zFar = 1000.0, fieldOfView = 45.0; | |
GLfloat size; | |
glMatrixMode(GL_PROJECTION); | |
glEnable(GL_DEPTH_TEST); | |
glDepthMask(GL_TRUE); | |
size = zNear * tanf(DEGREES_TO_RADIANS(fieldOfView) / 2.0); |
This file contains hidden or 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 is the main Apache HTTP server configuration file. It contains the | |
# configuration directives that give the server its instructions. | |
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information. | |
# In particular, see | |
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html> | |
# for a discussion of each configuration directive. | |
# | |
# Do NOT simply read the instructions in here without understanding | |
# what they do. They're here only as hints or reminders. If you are unsure |
This file contains hidden or 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 | |
file_path = ARGV[0] || 'go4_global_sub_navigation.html' | |
raise "#{file_path} does not exist, please specify which file you want to alter the navgo4_t_* on" unless File.exists?(file_path) | |
contents = File.read(file_path) | |
contents.gsub!(/<a(.+?)href\s*=\s*(['"].+?\?)navgo4_t_(.+?)(['"][^>]*)>(.+?)<\/a>/i) { |match| "<a href=#{$1}navgo4_t_#{$4.downcase.split(" ").join("_")}#{$3}>#{$4}</a>" } | |
wr = File.new(file_path, "w+") | |
wr.write(contents) | |
wr.close |
This file contains hidden or 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
To get Android working with 1.2.1 version of Titanium, I had to: | |
A) Create a new project with this new android.py file because the old one was broken ( http://developer.appcelerator.com/question/12431/12---android-brokenness---ks-never-loads-cant-launch-new-projects#29921 ) | |
B) Make it so that all my js files where updated so that the android.py deployer would correctly recognize they needed to be sent to the phone ( zsh: for i in **/*.js; touch $i ) | |
C) Fix some really weirdass startup exceptions (Note, to see the android log, change your log level in Titanium build window to Trace - lots of helpful info there. Or just use 'adb logcat' from the Android SDK.) http://developer.appcelerator.com/question/14701/javascript-parse-errors-on-android-with-function-closure-arguments | |
D) Ponder becoming an alcoholic. | |
E) Finally get my app to startup after refactoring all of our JS to avoid above problem, and then arrive at a blank screen. | |
F) Give up. | |
Also! You'll, want to upgrade your actual device to Android 1.6 or abo |
This file contains hidden or 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
[TRACE] D/TiFileFactory( 285): (kroll$1) [1,3069] getting initial from parts: app://vendor/jester.js | |
[TRACE] I/KrollContext( 285): (kroll$1) [1,3070] evalFile: file:///android_asset/Resources/vendor/jester.js | |
[TRACE] I/KrollContext( 285): (kroll$1) [4,3074] ThreadId: 8 currentThreadId: 8 | |
[TRACE] D/TiFileFactory( 285): (kroll$1) [2,3076] getting initial from parts: file:///android_asset/Resources/vendor/jester.js | |
[TRACE] D/dalvikvm( 285): GC freed 8227 objects / 622584 bytes in 103ms | |
[TRACE] I/global ( 285): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required. | |
[TRACE] I/dalvikvm( 285): Stack overflow, expanding (0x426ee200 to 0x426ee000) | |
[TRACE] E/dalvikvm( 285): Can't shrink stack: curFrame is in reserved area (0x426ee000 0x426ee1c8) | |
[TRACE] I/dalvikvm( 285): "kroll$1" prio=5 tid=15 RUNNABLE | |
[TRACE] I/dalvikvm( 285): | group="main" sCount=0 dsCount=0 s=N obj=0x43d21cb0 self=0x1355d0 |
This file contains hidden or 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
# For merbists that want to use Rails (or more appropriately, ActiveRecord) plugins that haven't yet | |
# been turned into gems | |
# Presumes that there exists a directory in your application root called "plugins" | |
def emulate_rails_plugins! | |
Merb.push_path(:plugins, Merb.root / "plugins", "*/lib/**/*.rb") | |
Dir[Merb.root / "plugins" / "*"].each do |entry| | |
$: << (entry / "lib") | |
if File.exists?(entry / "init.rb") | |
require(entry / "init.rb") | |
end |
NewerOlder