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 (typeof (AC) === "undefined") { | |
AC = {} | |
} | |
AC.ImageReplacer = Class.create({ | |
_defaultOptions: { | |
listenToSwapView: true, | |
filenameRegex: /(.*)(\.[a-z]{3}($|#.*|\?.*))/i, | |
filenameInsert: "_☃x", | |
ignoreCheck: /(^http:\/\/movies\.apple\.com\/|\/105\/|\/global\/elements\/quicktime\/|_(([2-9]|[1-9][0-9]+)x|nohires)(\.[a-z]{3})($|#.*|\?.*))/i, | |
attribute: "data-hires", |
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
#define DEGREES_TO_RADIANS(degrees) (degrees * M_PI / 180) | |
static CGAffineTransform transformForOrientation(UIInterfaceOrientation orientation) | |
{ | |
switch (orientation) { | |
case UIInterfaceOrientationLandscapeLeft: | |
return CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(90)); | |
case UIInterfaceOrientationLandscapeRight: | |
return CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(-90)); |
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
// | |
// RVNReceiptValidation.m | |
// | |
// Created by Satoshi Numata on 12/06/30. | |
// Copyright (c) 2012 Sazameki and Satoshi Numata, Ph.D. All rights reserved. | |
// | |
// This sample shows how to write the Mac App Store receipt validation code. | |
// Replace kRVNBundleID and kRVNBundleVersion with your own ones. | |
// | |
// This sample is provided because the coding sample found in "Validating Mac App Store Receipts" |
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
static | |
void divide_rect_from_rects(CGRect rect1, CGRect rect2, CGRect *slice, CGRect *remainder, CGRectEdge edge) | |
{ | |
NSCParameterAssert(slice); | |
NSCParameterAssert(remainder); | |
CGRect intersected = CGRectIntersection(rect1, rect2); | |
if (CGRectIsEmpty(intersected)) { | |
*slice = CGRectNull; | |
return; |
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
#!/bin/sh | |
sudo ifconfig en0 down | |
sudo ifconfig en1 down | |
sudo route -n flush | |
sudo ifconfig en0 up | |
sudo ifconfig en1 up |
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 Swift | |
class ClosureStackOverflow { | |
private var b: Bool = false | |
private func callClosure1(callback: Void -> Void) { | |
println("in closure 1") | |
callback() | |
} | |
private func callClosure2(callback: Void -> Void) { |
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 <Foundation/Foundation.h> | |
@class GCDMulticastDelegateEnumerator; | |
/** | |
* This class provides multicast delegate functionality. That is: | |
* - it provides a means for managing a list of delegates | |
* - any method invocations to an instance of this class are automatically forwarded to all delegates | |
* | |
* For example: |
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
// .h | |
@interface UIDevice (ProcessesAdditions) | |
- (NSArray *)runningProcesses; | |
@end | |
// .m | |
#import <sys/sysctl.h> | |
@implementation UIDevice (ProcessesAdditions) |
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
[General] | |
loglevel = notify | |
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24 | |
[Proxy] | |
// ADD YOUR PROXY HERE, DON'T FORGET TO REMOVE # | |
# Proxy = http,$IP,$PORT,$USERNAME,$PASSWORD | |
# Proxy = https,$IP,$PORT,$USERNAME,$PASSWORD |
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
#!/usr/bin/env runhaskell | |
-- Note: For a slight improvement in performance, import the non-portable | |
-- Data.Array.Unboxed module instead of Data.Array, and change the Board | |
-- type below to use "UArray" instead of "Array". | |
import Data.Array | |
-- Solve the example puzzle specified below | |
-- TODO: read puzzle from input | |
main = do |
OlderNewer