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
<?php | |
class Weather extends Common | |
{ | |
function __construct() | |
{ | |
} | |
public function deviceHistoryAggregate($deviceId,$type,$time=null){ | |
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
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation { | |
static NSString *identifier = @"PPSpot"; | |
if ([annotation isKindOfClass:[PPSpot class]]) { | |
PPAnnotationView *annotationView = (PPAnnotationView *) [mapView dequeueReusableAnnotationViewWithIdentifier:identifier]; | |
annotationView = [[PPAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:identifier]; | |
annotationView.parent = self; | |
NSString *text = @""; |
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)setupInvaders { | |
NSMutableArray *start = [NSMutableArray array]; | |
for (int i = 0; i < kInvaderRowCount*kInvaderColCount; ++i) { | |
[start addObject:@(i)]; | |
} | |
CGPoint baseOrigin = CGPointMake(kInvaderSize.width / 2, 180); | |
RACSequence *aliens = [start.rac_sequence map:^(id value){ | |
NSUInteger row = [value integerValue]/kInvaderColCount; | |
NSUInteger col = [value integerValue]%kInvaderColCount; |
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
func qs<T: Comparable>(ary: T[]) -> T[] { | |
if ary.isEmpty { | |
return [] | |
} | |
let x = ary[0] | |
let xs = ary[1..ary.count] | |
let smallerSorted = qs(Array(filter(xs) { $0 <= x })) | |
let biggerSorted = qs(Array(filter(xs) { $0 > x })) |
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
protocol Observable { | |
func observe(onUpdate: (Void) -> Void) -> String | |
func unobserve(key: String) | |
} | |
class ObservableDispatcher { | |
var observerClosures: Dictionary<String, (Void) -> Void> = Dictionary<String, (Void) -> Void>() | |
func observe(onUpdate: (Void) -> Void) -> String { | |
let key = "key_\(observerClosures.count+1)_key" |
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
protocol Observable { | |
func observe(onUpdate: (Void) -> Void) -> String | |
func unobserve(key: String) | |
} | |
class ObservableDispatcher { | |
var observerClosures: Dictionary<String, (Void) -> Void> = Dictionary<String, (Void) -> Void>() | |
func observe(onUpdate: (Void) -> Void) -> String { | |
let key = "key_\(observerClosures.count+1)_key" |
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
import Foundation | |
enum LayoutToken: StringLiteralConvertible { | |
case Plain(Int) | |
case Container(Int) | |
case ComponentId(Int) | |
func description() -> String{ | |
switch self { | |
case .Plain(let value): |
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
Verifying that +giordano_scalzo is my blockchain ID. https://onename.com/giordano_scalzo |
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
import UIKit | |
@IBDesignable | |
class SpinnableArtwork: UIView { | |
@IBOutlet var view: UIView! | |
@IBOutlet var artworkImageView: UIImageView! | |
@IBOutlet var playerButton: PlayerButton! | |
@IBInspectable var imageName: String! { | |
didSet { |
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
#!/bin/bash | |
pbpaste|sed 's/^[[:space:]]*"//g'|sed 's/"$//g' |sed 's/\\"/"/g'|sed 's/\\\\/\\/g'|pbcopy |
OlderNewer