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
h1. Sublime Text 2 - Useful Shortcuts (Mac OS X) | |
h2. General | |
| *⌘T* | go to file | | |
| *⌘⌃P* | go to project | | |
| *⌘R* | go to methods | | |
| *⌃G* | go to line | | |
| *⌘KB* | toggle side bar | | |
| *⌘⇧P* | command prompt | |
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
<IfModule mod_deflate.c> | |
AddOutputFilterByType DEFLATE application/atom+xml \ | |
application/javascript \ | |
application/json \ | |
application/rss+xml \ | |
application/vnd.ms-fontobject \ | |
application/x-font-ttf \ | |
application/xhtml+xml \ | |
application/xml \ | |
font/opentype \ |
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
// add this method to ZXAztecDecoder.m (ZXingObjC) | |
+ (NSString *)UIC9183TicketId:(ZXBoolArray *)correctedBits | |
{ | |
NSMutableData *bytes = [[NSMutableData alloc] init]; | |
int endIndex = (int)correctedBits.length; | |
ZXAztecTable latchTable = ZXAztecTableUpper; // table most recently latched to | |
ZXAztecTable shiftTable = ZXAztecTableUpper; // table to use for the next read | |
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 | |
public extension Character { | |
/// Determine if the character is a space, tab or newline | |
public func isSpace() -> Bool { | |
return self == " " || self == "\t" || self == "\n" || self == "\r" | |
} | |
/// Conver the character to a UTF16 code unit | |
public var utf16: UInt16 { |
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
// derived from https://www.veasoftware.com/posts/uipageviewcontroller-in-swift-xcode-62-ios-82-tutorial | |
import UIKit | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | |
window = UIWindow(frame: UIScreen.mainScreen().bounds) | |
window!.rootViewController = ViewController() |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>BackgroundColor</key> | |
<string>0d2733</string> | |
<key>CharColor</key> | |
<string>cc256f</string> | |
<key>ClassColor</key> | |
<string>c1371f</string> |
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
// | |
// QRScanVC.swift | |
// | |
// Created by Farshchi, Navid on 1/2/18. | |
// | |
import UIKit | |
import AVFoundation | |
class QRScanVC: UIViewController, AVCaptureMetadataOutputObjectsDelegate { |
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
## EXPIRES CACHING ## | |
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresByType image/jpg "access plus 1 month" | |
ExpiresByType image/jpeg "access plus 1 month" | |
ExpiresByType image/gif "access plus 1 month" | |
ExpiresByType image/png "access plus 1 month" | |
ExpiresByType text/css "access plus 1 month" | |
ExpiresByType text/html "access plus 1 day" | |
ExpiresByType text/php "access plus 1 day" |
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
<?php | |
function time2str($ts) { | |
if(!ctype_digit($ts)) { | |
$ts = strtotime($ts); | |
} | |
$diff = time() - $ts; | |
if($diff == 0) { | |
return 'now'; | |
} elseif($diff > 0) { | |
$day_diff = floor($diff / 86400); |
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
const $ = document.querySelector.bind(document); | |
const $$ = document.querySelectorAll.bind(document); |
OlderNewer