Skip to content

Instantly share code, notes, and snippets.

View shirlymanor's full-sized avatar

Shirly Manor shirlymanor

View GitHub Profile
class OrderAssetsZipDownloadCreator
def self.build(order_id, force = false)
@order = Order.find(order_id)
@force = force
unless @order.download_zip_url.present? #prevent duplicate images from being added to zip.
reupload_assets_with_tag
#create_zip
end
var cloudinary = require('cloudinary').v2;
cloudinary.config({
cloud_name: "<CLOUD NAME>",
api_key: "<API KEY>",
api_secret: "<API SECRET>"
});
var result = [];
var options = { type: "upload", max_results: 500, prefix: "<Name of the Folder>/" }; //Add you folder name + `/`
@shirlymanor
shirlymanor / error-ios.md
Last active August 24, 2017 22:02
Instructions in case you encounter with an error on iOS

In case you get the following error:

ERROR: ERROR: Failed to determine SDK version for iphonesimulator
xcrun: error: SDK "iphonesimulator" cannot be located
xcrun: error: SDK "iphonesimulator" cannot be located
xcrun: error: unable to lookup item 'SDKVersion' in SDK 'iphonesimulator'

First try

@shirlymanor
shirlymanor / InterviewWithSwift
Created March 29, 2017 21:35
First question (based on google interview question). Giving a collection of numbers and you will need to find a matching pair that are equal to the number that I'll give you.
import UIKit
/*
Question - I'm giving you a collection of numbers and you will need to find a matching pair that are equal to the number that I'll give you.
So for example the collection of number will be: [1,2,3,9] and the sum that I'm looking for is 8.
An another example will be [1,2,4,4] and the sum is 8
A- so, I'm trying to understand. You are looking for a pair of numbers that add up to 8
@shirlymanor
shirlymanor / gist:1069116d0b26d52b4a86fd0573185d1c
Created May 12, 2016 19:12
Algorithm with Swift: Find prime, create power func, string manipulation
//Create a function to print prime number from 1 to 100
func prime()
{
for index in 1...100
{
if(!isNotPrime(index)){
print(index)
}
}