Skip to content

Instantly share code, notes, and snippets.

View myobie's full-sized avatar

Nathan myobie

View GitHub Profile
#!/bin/sh
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.3.9.tar.gz
tar xzvf freetype-2.3.9.tar.gz
cd freetype-2.3.9
./configure --prefix=/usr/local
make
sudo make install
cd ..
wget http://superb-west.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.35.tar.bz2
class Yellow < PostType
fields :one
html {
haml %Q{
%h1= get_attr(:one)
}.indents
}
end
public static function dispatchEvent(p_event:Event):void {
if (disp == null) { return; }
disp.dispatchEvent(p_event);
}
public static function addEventListener(p_type:String, p_listener:Function, p_useCapture:Boolean=false, p_priority:int=0, p_useWeakReference:Boolean=false):void {
if (disp == null) { disp = new EventDispatcher(); }
disp.addEventListener(p_type, p_listener, p_useCapture, p_priority, p_useWeakReference);
}
public static function removeEventListener(p_type:String, p_listener:Function, p_useCapture:Boolean=false):void {
// CustomEvent.as
package com.utils {
import flash.events.Event;
public class CustomEvent extends Event {
// event constants
public static const EVENT_NAME:String = "eventName";
public static const OTHER_EVENT:String = "otherEvent";
How to use a navigation controller view both as a part of an existing navigation controller stack and a modal view
==================================================================================================================
MainMenu.xib
(delegate) => AppDelegate
(window) => UIWindow
(editControlller) => EditViewController
(mainController) => MainViewController
(navController) => UINavigationController
- (showEditFor:) => [navController pushViewController:editController animated:YES]
start_t = Time.now.to_f
test.line_count # => 31
Time.now.to_f - start_t # => 0.0107550621032715
start_t = Time.now.to_f
test.inject(0) { |sum, line| sum+1 } # => 31
Time.now.to_f - start_t # => 0.000140905380249023
diff --git a/vendor/plugins/is_taggable/lib/is_taggable.rb b/vendor/plugins/is_taggable/lib/is_taggable.rb
index ba2f9a2..5f9e6ae 100644
--- a/vendor/plugins/is_taggable/lib/is_taggable.rb
+++ b/vendor/plugins/is_taggable/lib/is_taggable.rb
@@ -9,7 +9,7 @@ module IsTaggable
@@delimiter = ','
def initialize(list)
- list = list.is_a?(Array) ? list : list.split(@@delimiter).collect(&:strip)
+ list = list.is_a?(Array) ? list : list.split(@@delimiter).collect(&:strip).reject(&:blank?)
{
"total_rows":3,
"offset":0,
"rows":[
{
"id":"06a1b6e367cd059362bc3a7921b64b45",
"key":"06a1b6e367cd059362bc3a7921b64b45",
"value":{"rev":"5-2613703449"}
},
{
module Asset
include DataMapper::Resource
# is :remixable
property :id, Serial
property :size, Integer
property :content_type, String
property :filename, String, :length => 255
association = history.ticket.model.relationships.select { |key, value|
value.child_key.named?(field_name.to_sym) && value.child_key.length == 1
}
unless association.empty? || association.first.length != 2
self.belongs_to_class = association.first[1].parent_model.to_s
end#of unless