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
# Some request interrogations | |
po operation.request.HTTPMethod | |
po operation.request.allHTTPHeaderFields | |
# Prints out HTTPBody as string, using NSUTF8StringEncoding | |
expr (void)NSLog(@"%@", (NSString *)[[NSString alloc] initWithData:operation.request.HTTPBody encoding:4]); |
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 | |
# | |
# PostprocessBuildPlayer version 2 | |
# Tested on Ruby 1.8.7, Gem 1.3.6, and xcodeproj 0.4.1 | |
# Created by akisute (http://akisute.com) | |
# Licensed under The MIT License: http://opensource.org/licenses/mit-license.php | |
# | |
require 'rubygems' | |
# least require version, doesn't work in 0.3.X or less |
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)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender | |
{ | |
if ([segue.identifier isEqualsToString:@"Special"]) { | |
[self doSomething]; | |
} else if ([segue.sourceViewController isKindOfClass:[MyViewController class]] && [segue.destinationViewController isKindOfClass:[MyDetailViewController class]]) { | |
MyDetailViewController *vc = segue.destinationViewController; | |
vc.someInfo = self.someInfo; | |
} else if ([segue.sourceViewController isKindOfClass:[MyViewController class]] && [segue.destinationViewController isKindOfClass:[MyModalViewController class]]) { | |
MyModalViewController *vc = segue.destinationViewController; | |
vc.someInfo = self.someInfo; |
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)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender | |
{ | |
// | |
// We NEED this kind of pattern matcher, don't we!? ;( | |
// | |
match(@[segue.identifier, segue.sourceViewController, segue.destinationViewController]) | |
{ | |
case @[@"Special", _, _]: ^(_, _, _){ | |
[self doSomething]; | |
} |
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
# Just comment out these lines in L4428 before ./configure | |
if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then | |
{ { echo "$as_me:4429: error: Cross-build requires two compilers. | |
Use --with-build-cc to specify the native compiler." >&5 | |
echo "$as_me: error: Cross-build requires two compilers. | |
Use --with-build-cc to specify the native compiler." >&2;} | |
{ (exit 1); exit 1; }; } | |
fi |
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
# -*- coding: utf-8 -*- | |
import datetime | |
from django.contrib.admin.models import LogEntry, ADDITION, CHANGE | |
class MoniterLog(admin.ModelAdmin): | |
#dt_utc = datetime.datetime.strptime('action_time', '%Y-%m-%d %H:%M:%S') | |
#str_utc = 'action_time' | |
#dt_utc = datetime.datetime.strptime(str_utc, '%Y-%m-%d %H:%M:%S') | |
#dt_jst = dt_utc + datetime.timedelta(0,3600) | |
#str_jst = dt_jst.strftime('%Y/%m/%d %H:%M:%S') |
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
NSUInteger DeviceSystemMajorVersion(); | |
NSUInteger DeviceSystemMajorVersion() { | |
static NSUInteger _deviceSystemMajorVersion = -1; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
_deviceSystemMajorVersion = [[[[[UIDevice currentDevice] systemVersion] componentsSeparatedByString:@"."] objectAtIndex:0] intValue]; | |
}); | |
return _deviceSystemMajorVersion; | |
} | |
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
// http://tour.golang.org/#70 | |
package main | |
import ( | |
"fmt" | |
) | |
type Fetcher interface { | |
// Fetch returns the body of URL and |
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
// http://go-tour-jp.appspot.com/#23 | |
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Sqrt(x float64) float64 { |
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
using UnityEngine; | |
using System.Collections; | |
using System; | |
public class FuckIt : MonoBehaviour { | |
// Use this for initialization | |
void Start () { | |
DateTime now = DateTime.Now; | |
Debug.Log (now); // Add a breakpoint here and IT CRASHES |