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
// | |
// Macros.swift | |
// | |
// Created by Xavier Muñiz on 6/12/14. | |
import Foundation | |
// dLog and aLog macros to abbreviate NSLog. | |
// Use like this: |
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
"Author: Zoltán Bognár | |
"put into ~/ | |
syntax enable | |
set hls | |
highlight Search guibg=#7D2F52 | |
set bg=light | |
set tabstop=4 | |
set softtabstop=4 | |
set shiftwidth=4 | |
set scrolloff=2 |
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
// Swift Standard Librray - String | |
// Keith Harrison http://useyourloaf.com | |
// Import Foundation if you want to bridge to NSString | |
import Foundation | |
// ==== | |
// Initializing a 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
#copy directory hierarchy without files | |
pathFrom$ find . -type d -exec mkdir -p /pathTo/{} \; |
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
//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 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
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
NSString *documentsDirectory = [paths objectAtIndex:0]; | |
NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent: | |
[NSString stringWithFormat:@"savedImage%lu.png",arrayOfImages.count]]; | |
NSData *imageData = UIImagePNGRepresentation(imageObject); | |
[imageData writeToFile:savedImagePath atomically:NO]; |
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
NSLog(@"Documents Directory: %@", | |
[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory | |
inDomains:NSUserDomainMask] lastObject]); |
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
DirectorySlash Off | |
Options +FollowSymlinks -Indexes -MultiViews | |
AddDefaultCharset utf-8 | |
DirectoryIndex /public/index.php | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f |
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
// | |
// main.cpp | |
// OpenGL-examples | |
// | |
// Created by Alexey Potapov on 27.09.14. | |
// Copyright (c) 2014 none. All rights reserved. | |
// | |
#include <stdlib.h> | |
#include <stdio.h> |
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
Delete .svn files using bash | |
find . -name .svn -exec rm -rf '{}' \; |