Skip to content

Instantly share code, notes, and snippets.

View alekseypotapov-dev's full-sized avatar

Aleksey Potapov alekseypotapov-dev

View GitHub Profile
@alekseypotapov-dev
alekseypotapov-dev / Macros.swift
Created April 14, 2016 11:59 — forked from xmzio/Macros.swift
My aLog and dLog macros in Swift (to abbreviate NSLog)
//
// Macros.swift
//
// Created by Xavier Muñiz on 6/12/14.
import Foundation
// dLog and aLog macros to abbreviate NSLog.
// Use like this:
@alekseypotapov-dev
alekseypotapov-dev / .xvimrc
Last active March 29, 2016 20:13
handy .xvimrc configurator for Xcode, see this repo: github.com/XVimProject/XVim
"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
@alekseypotapov-dev
alekseypotapov-dev / String.swift
Created December 16, 2015 23:01 — forked from kharrison/String.swift
Swift String Playground Examples
// Swift Standard Librray - String
// Keith Harrison http://useyourloaf.com
// Import Foundation if you want to bridge to NSString
import Foundation
// ====
// Initializing a String
// ====
@alekseypotapov-dev
alekseypotapov-dev / bash.txt
Last active December 11, 2015 15:01
bash usefult commands
#copy directory hierarchy without files
pathFrom$ find . -type d -exec mkdir -p /pathTo/{} \;
@alekseypotapov-dev
alekseypotapov-dev / SwiftC.swift
Created December 4, 2015 15:51
Swift with C example
//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 }
@alekseypotapov-dev
alekseypotapov-dev / saveImg.m
Created March 6, 2015 12:36
Save image to Documents folder
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];
@alekseypotapov-dev
alekseypotapov-dev / FolderLocation.m
Last active April 18, 2021 10:02
Find the ios simulator's application folder documents on Mac
NSLog(@"Documents Directory: %@",
[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory
inDomains:NSUserDomainMask] lastObject]);
DirectorySlash Off
Options +FollowSymlinks -Indexes -MultiViews
AddDefaultCharset utf-8
DirectoryIndex /public/index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
@alekseypotapov-dev
alekseypotapov-dev / PolygonInCircle.cpp
Last active August 29, 2015 14:07
This is a 4th example for the first OpenGL lesson
//
// 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>
@alekseypotapov-dev
alekseypotapov-dev / bash
Created August 5, 2014 10:14
Delete SVN files
Delete .svn files using bash
find . -name .svn -exec rm -rf '{}' \;