Skip to content

Instantly share code, notes, and snippets.

// Bonfire: Chunky Monkey
// Author: @eridbardhaj
// Challenge: http://www.freecodecamp.com/challenges/bonfire-chunky-monkey?solution=function%20chunk(arr%2C%20size)%20%7B%0A%20%20var%20i%3D0%3B%0A%20%20var%20edArr%20%3D%20%5B%5D%3B%0A%20%20while%20(arr.length%3E0)%20%7B%0A%20%20%20%20var%20sub%20%3D%20%5B%5D%3B%0A%20%20%20%20var%20number%20%3D%20(arr.length%20%3E%20size)%20%3F%20size%20%3A%20arr.length%3B%0A%20%20%20%20console.log(number)%3B%0A%20%20%20%20%0A%20%20%20%20for%20(var%20j%3D0%3B%20j%3Cnumber%3B%20j%2B%2B)%20%7B%0A%20%20%20%20%20%20sub.push(arr%5B0%5D)%3B%0A%20%20%20%20%20%20console.log(arr%5B0%5D)%3B%0A%20%20%20%20%20%20arr.shift()%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0A%20%20%20%20edArr.push(sub)%3B%0A%20%20%7D%0A%20%20%2F%2F%20Break%20it%20up.%0A%20%20return%20edArr%3B%0A%7D%0A%0Achunk(%5B%22a%22%2C%20%22b%22%2C%20%22c%22%2C%20%22d%22%5D%2C%202)%3B%0A%0Aconsole.log(chunk(%5B%22a%22%2C%20%22b%22%2C%20%22c%22%2C%20%22d%22%5D%2C%202))%3B%0A%0A%0A
// Learn to Code at Free Code Camp (www.freecodecam
@eridbardhaj
eridbardhaj / EBCustomTextView.h
Last active March 8, 2016 15:13
CustomTextViewMenu
//
// EBCustomTextView.h
// TestProject
//
// Created by Erid Bardhaj on 3/8/16.
// Copyright © 2016 Erid Bardhaj. All rights reserved.
//
#import <UIKit/UIKit.h>
@eridbardhaj
eridbardhaj / GoogleMapsViewController.swift
Created August 28, 2018 13:48
A working sample to GoogleMaps SDK, for downloading and binding images from a specific `URL` to a `GMSMarker`
//
// GoogleMapsViewController.swift
//
// Created by Erid Bardhaj on 8/20/18.
// Copyright © 2018 Erid Bardhaj. All rights reserved.
//
import UIKit
import GoogleMaps
import Foundation
import PlaygroundSupport
/// A thread-safe array.
public class SynchronizedArray<Element> {
private let queue = DispatchQueue(label: "io.zamzam.ZamzamKit.SynchronizedArray", attributes: .concurrent)
private var array = [Element]()
public init() { }