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
txtblk='\e[0;30m' # Black - Regular | |
txtred='\e[0;31m' # Red | |
txtgrn='\e[0;32m' # Green | |
txtylw='\e[0;33m' # Yellow | |
txtblu='\e[0;34m' # Blue | |
txtpur='\e[0;35m' # Purple | |
txtcyn='\e[0;36m' # Cyan | |
txtwht='\e[0;37m' # White | |
bldblk='\e[1;30m' # Black - Bold | |
bldred='\e[1;31m' # Red |
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
- (void)viewDidAppear:(BOOL)animated | |
{ | |
[super viewDidAppear:animated]; | |
if (!self.tabBarIsShowing) { | |
self.tabBar.hidden = YES; | |
} | |
} |
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
// paperlesspost.com/api/v100/event?id=3948 | |
//{ | |
// id: 3948, | |
// eventName: "The Party For the LOLZ", | |
// hostName: "datFoolCuzzo" | |
// | |
//} | |
protocol JSONDecodable { | |
static func decode(json: JSON) -> Self? |
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
//adding without currying | |
func add(a: Int, b:Int) -> Int { | |
return a + b | |
} | |
//when we use the swift curry form this is what is happening behind the scenes | |
func addCurry(a: Int) -> (Int -> Int) { |
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
struct Datasource { | |
static let _items = ["Cats", "Dogs", "Crows", "Lions", "Owls", "Hawks", "Fish"] | |
static let items = Datasource._items + Datasource._items | |
static func validIndiciesForSelectedIndex(index: Int) -> (Int, Int) { | |
var offset: Int = 0 |
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
import UIKit | |
import ReactiveCocoa | |
extension NSTimer { | |
/** | |
Creates and schedules a one-time `NSTimer` instance. | |
:param: delay The delay before execution. | |
:param: handler A closure to execute after `delay`. | |
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
public class DataHandler extends EventDispatcher { | |
private static var _instance:DataHandler; | |
private static var allowInstantiation:Boolean; | |
private var xmlPath:String; | |
private var xml:XML; | |
private var xmlLoader:URLLoader; | |
private static var _xmlpath:String; | |
public function setXMLPath (thisXML:String) : void { | |
_xmlpath = thisXML; |
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
public class DataHandler extends EventDispatcher { | |
private static var _instance:DataHandler; | |
private static var allowInstantiation:Boolean; | |
private var xmlPath:String; | |
private var xml:XML; | |
private var xmlLoader:URLLoader; | |
private static var _xmlpath:String; | |
public function setXMLPath (thisXML:String) : void { | |
_xmlpath = thisXML; |
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
class Recipe < MongoRecord::Base | |
collection_name :recipes | |
fields :name, :directions, :words | |
def to_s | |
"recipe: #{name} directions: #{directions[0..20]}..." | |
end | |
def Recipe.make collection, name, directions | |
collection.insert({:_id => Mongo::ObjectID.new, :name => name, | |
:directions => directions, | |
:words => (name + ' ' + directions).split.uniq}) |
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
if(strcasecmp(get_class($id), "mongoid")) { | |
$_id = $_id->{'$id'}; | |
} | |
$this->data=Db::$tours->findOne(array('_id'=>new MongoId($_id))); |
OlderNewer