Skip to content

Instantly share code, notes, and snippets.

View mikekavouras's full-sized avatar

Mike Kavouras mikekavouras

View GitHub Profile
//: Playground - noun: a place where people can play
import UIKit
struct Obj {
let id: String
init(id: String) {
self.id = id
}
}
var support = function() {
var str = 'Teespring';
try {
localStorage.setItem(mod, mod);
localStorage.removeItem(mod);
return true;
} catch(e) {
return false;
}
}();
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{
guard let cell = tableView.dequeueReusableCellWithIdentifier("roundsIdentifier", forIndexPath:indexPath) as? CustomRoundsTableViewCell else {
return UITableViewCell()
}
let round = roundsArray[indexPath.row]
cell.roundNumberLabel?.text = "Round \(round.value)"
cell.redScoreLabel?.text = String(round.redScore)
@mikekavouras
mikekavouras / vim_config.txt
Created February 12, 2016 18:46
vim config
Plugin 'Valloric/YouCompleteMe' " autocomplete
Plugin 'marijnh/tern_for_vim'
Plugin 'pangloss/vim-javascript' " js syntax
Plugin 'Raimondi/delimitMate'
Plugin 'scrooloose/syntastic'
Plugin 'fatih/vim-go' " go syntax
Plugin 'tpope/vim-rails' " rails
Plugin 'tpope/vim-haml' " haml/sass/scss
Plugin 'elzr/vim-json' " format json
def leopard
end
func VowelRemover(str: String) -> String {
let vowels: [Character] = ["a", "e", "i", "o", "u"]
let chars = str.characters.filter { !vowels.contains($0) }.map { String($0) }
return chars.joinWithSeparator("")
// 1 liner
// str.characters.filter { !["a", "e", "i", "o", "u"].contains($0) }.map { String($0) }.joinWithSeparator("")
}
//: Playground - noun: a place where people can play
import UIKit
print("hello")
func generateRoute(coords: [(Double, Double)]) -> [(Double, Double)] {
var route = [(Double, Double)]()
for (i, coord) in coords.enumerate() {
guard i > 0 else { continue }
#include <stdio.h>
#include <math.h>
int main()
{
float pi = 3.141592;
float i;
float bulb1;
float bulb2;
float bulb3;
func collectionView(_ collectionView: UICollectionView,
layout collectionViewLayout: UICollectionViewLayout,
sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize
NSArry *bxLats = @[
@(40.820045),
@(40.821045),
@(40.822045),
@(40.823045),
@(40.824045),
@(40.825045),
@(40.826045),
@(40.827045),
@(40.828045),