Skip to content

Instantly share code, notes, and snippets.

@dinneo
dinneo / FlickrSearcher.swift
Created November 12, 2015 15:08 — forked from john-difool/FlickrSearcher.swift
FlickrSearcher.swift updated for iOS 9 / XCode 7 / Swift 2.x
//
// FlickrSearcher.swift
// flickrSearch
//
// Created by Richard Turton on 31/07/2014.
// Modified by John Difool on 10/01/2015.
// Copyright (c) 2014 Razeware. All rights reserved.
//
import Foundation
@dinneo
dinneo / parse_aws.md
Created September 23, 2016 03:19 — forked from hassy/parse_aws.md
Deploying Parse Server on AWS (WIP)

Deploying Parse Server on AWS

Note: this is a work-in-progress and will be updated with more information over the next few days.

Intro

This guide will walk you through deploying your own instance of the open-source Parse Server. This would be a good starting point for testing your existing application to see if the functionality provided by the server is enough for your application, and to potentially plan your migration off the Parse Platform.

This guide will walk you through using Elastic Beanstalk (EB), which is an AWS service similar to Heroku. Why use EB rather than Heroku? Elastic Beanstalk does not lock you into Heroku-specific ways of doing things, is likely cheaper to run your backend on than Heroku, and it integrates with other services that AWS offer (and they offer almost everything one needs to run an application these days).

@dinneo
dinneo / git-delete-history.sh
Created September 29, 2016 15:54 — forked from zerolab/git-delete-history.sh
Script to permanently delete files/folders form your git repository
#!/bin/bash
set -o errexit
# Author: David Underhill
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-delete-history path1 path2
if [ $# -eq 0 ]; then
exit 0
@dinneo
dinneo / IAPHelper.txt
Created October 2, 2016 14:17 — forked from speaktoalvin/IAPHelper.txt
In App Purchase in Swift, with Receipt Validation
import UIKit
import StoreKit
//MARK: SKProductsRequestDelegate
extension IAPHelpers : SKProductsRequestDelegate
{
func productsRequest(request: SKProductsRequest, didReceiveResponse response: SKProductsResponse)
{
//First Implementation
func numberOfVowelsInString(string: String) -> Int {
let vowels: [Character] = ["a", "e", "i", "o", "u", "A", "E", "I", "O", "U"]
var numberOfVowels = 0
for character in string.characters {
if vowels.contains(character) {
numberOfVowels += 1
}
/*
* This is an example provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
@dinneo
dinneo / ConcurrentOperation.swift
Created December 22, 2016 04:30 — forked from calebd/AsynchronousOperation.swift
Concurrent NSOperation in Swift
import Foundation
/// An abstract class that makes building simple asynchronous operations easy.
/// Subclasses must implement `execute()` to perform any work and call
/// `finish()` when they are done. All `NSOperation` work will be handled
/// automatically.
open class Operation: Foundation.Operation {
// MARK: - Properties
@dinneo
dinneo / yolo.sh
Created December 31, 2016 17:09 — forked from nlutsenko/yolo.sh
Fast Xcode builds
defaults write xcodebuild PBXNumberOfParallelBuildSubtasks 4
defaults write xcodebuild IDEBuildOperationMaxNumberOfConcurrentCompileTasks 4
defaults write com.apple.xcode PBXNumberOfParallelBuildSubtasks 4
defaults write com.apple.xcode IDEBuildOperationMaxNumberOfConcurrentCompileTasks 4
@dinneo
dinneo / struct_vs_inheritance.swift
Created December 31, 2016 22:53 — forked from AliSoftware/struct_vs_inheritance.swift
Swift, Struct & Inheritance: How to balance the will of using Struct & Value Types and the need for Inheritance?
// #!Swift-1.1
import Foundation
// MARK: - (1) classes
// Solution 1:
// - Use classes instead of struct
// Issue: Violate the concept of moving model to the value layer
// http://realm.io/news/andy-matuschak-controlling-complexity/
@dinneo
dinneo / multiple_ssh_setting.md
Created January 18, 2017 14:21 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"