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 | |
require_once realpath(dirname(__FILE__) . '/vendor/autoload.php'); | |
include_once "google-api-php-client/examples/templates/base.php"; | |
$client = new Google_Client(); | |
/************************************************ | |
ATTENTION: Fill in these values, or make sure you | |
have set the GOOGLE_APPLICATION_CREDENTIALS |
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 | |
import Compression | |
/// A convenience class for compressing an NSData object. | |
/// | |
/// Example: | |
/// ``` | |
/// let compression = Compression(algorithm: .ZLIB) | |
/// let compressedData = compression.compressData(data) | |
/// let decompressedData = compresison.decompressData(compressedData) |
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 | |
//## iOS:ファイルシステム ##### | |
//標準ディレクトリ ( Documents/, Library/, tmp/ ... ) | |
//## OS X:ファイルシステム ##### | |
//ローカルドメイン ( Applications/Utilities, Developer/, Library/ ) | |
//ユーザードメイン ( Users/user1, ... ) | |
//ファイルまたはディレクトリのパス |
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
//original video https://realm.io/news/pragma-chris-eidhof-swift-c/ | |
import Foundation | |
extension Comparable { | |
static func compare (l: UnsafePointer<Void>, _ r: UnsafePointer<Void>) -> Int32 { | |
let left: Self = UnsafePointer(l).memory | |
let right: Self = UnsafePointer(r).memory | |
if left < right { return -1 } | |
if left == right { return 0 } |
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 | |
// apitest.php | |
// by Karl Kranich - karl.kranich.org | |
// version 3.1 - edited query section | |
require_once realpath(dirname(__FILE__) . '/vendor/autoload.php'); | |
include_once "google-api-php-client/examples/templates/base.php"; | |
$client = new Google_Client(); |
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/osascript | |
(* | |
--------------------------------------------------------------------------------- | |
Script: SpreadsheetExportToCSV | |
Command-line tool to convert a spreadsheet document to CSV | |
This AppleScript is tested with and compatible with Apple iWork Numbers 3.6, | |
current as at October 23, 2015. |
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
10.3 (Panther): | |
https://swscan.apple.com/scanningpoints/scanningpointX.xml | |
10.4 (Tiger): | |
https://swscan.apple.com/content/catalogs/index.sucatalog | |
https://swscan.apple.com/content/catalogs/index-1.sucatalog | |
10.5 (Leopard): | |
https://swscan.apple.com/content/catalogs/others/index-leopard.merged-1.sucatalog |
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 getProductIdFromReceipt(_ data:Data) -> String? //Swift 2: func getProductIdFromReceipt(data:NSData) -> String? | |
{ | |
//Swift 2: var p = UnsafePointer<UInt8>(data.bytes) | |
//Swift 3 | |
var p : UnsafePointer? = (data as NSData).bytes.bindMemory(to: UInt8.self, capacity: data.count) | |
let dataLength = data.length | |
var type:Int32 = 0 | |
var tag:Int32 = 0 |
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 Firebase from 'firebase'; | |
import Promise from 'bluebird'; | |
import {ValidationError} from './lib/validation'; | |
import {firebaseCursor} from './state'; | |
// if (!process.env.IS_BROWSER) { | |
// // TODO: Set Firebase for server. | |
// } | |
export const TIMESTAMP = Firebase.ServerValue.TIMESTAMP; |
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
* strong, weak, assign | |
http://stackoverflow.com/questions/8927727/objective-c-arc-strong-vs-retain-and-weak-vs-assign | |
* bridge (void* => id, id => void*) | |
http://stackoverflow.com/questions/18976016/how-to-specify-property-to-c-pointer-in-arc-environment | |
* arr.indexOf | |
```Objective-C | |
//BAD: it returns max int. | |
(int)[arr indexOfObject:obj]>0 |