Skip to content

Instantly share code, notes, and snippets.

@normand1
normand1 / swift-vs-objc.md
Last active August 29, 2015 14:25 — forked from raheelahmad/swift-vs-objc.md
Swift vs. Objective-C

Swift vs. Objective-C

Why Swift would be a better choice for the next production app.

Strong typing

  • correctness at compile time (besides behavior)
  • types as proofs (... illegal is impossible)
    • vs. testing
  • Examples
@normand1
normand1 / git-export
Created July 17, 2016 18:24 — forked from kristofferh/git-export
"Export" a git repository to zip file
git archive --format zip --output /full/path/to/zipfile.zip master
@normand1
normand1 / The Technical Interview Cheat Sheet.md
Created June 27, 2019 04:25 — forked from prashant-shahi/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Big-O Complexity Chart

Data Structure Basics

Common Data Structure operations

@normand1
normand1 / gist:c6890b85f9ff1a6fab41288caa9aaeb6
Last active September 3, 2019 17:27
testInteractorLocationValueChangedUpdatesCityParamsWithValueFromTexField
func testInteractorLocationValueChangedUpdatesCityParamsWithValueFromTexField() {
// Arrange
mockVC.stubbedViewModel.locationType = .city
textField.text = "NEW CITY"
// Act
interactor.locationValueChanged(sender: textField, viewController: mockVC)
//Assert
XCTAssert(mockVC.invokedOpenWeatherRequestParamsSetter)
@normand1
normand1 / weatherapiexample.swift
Last active September 23, 2019 04:11
weatherapiexample.swift
private func fetchWeatherForZipCode(zipCode: String) -> Promise<OpenWeatherModel> {
let zipCodeQuery = URLQueryItem(name: "zip", value: "\(zipCode.trimmingCharacters(in: .whitespacesAndNewlines)),us")
return APIManager().sendRequest(queries: [zipCodeQuery])
}
{"endTimeInSec":5282.862064383,"elementId":"F4B646D2-0DFF-4D37-B4F3-26D8CDFD4419","title":"No Agenda Social Invite","url":"Https:\/\/noagendasocial.com\/invite\/fnBmg2P6 ","startTimeInSec":5281.862064383}
{"title":"Tante Neel Art","url":"https:\/\/noagendaartgenerator.com\/artwork\/18211","elementId":"2D935040-27DF-4C43-81EF-9A0A9ED1A77D","startTimeInSec":5384.0217897519997,"endTimeInSec":5385.0217897519997}
{"startTimeInSec":5444.5242019810003,"endTimeInSec":5445.5242019810003,"elementId":"94181332-3ABD-4566-A510-49C920CEA2A1","title":"Darren's Cheese cake","url":"https:\/\/noagendaartgenerator.com\/artwork\/18239"}
{"url":"https:\/\/noagendaartgenerator.com\/artwork\/18250","title":"Toobin","startTimeInSec":5505.5115713610003,"elementId":"F0424528-BAB0-48B8-82AD-8312349B1DA4","endTimeInSec":5506.5115713610003}
{"elementId":"CC3D9F4C-A910-4A18-A307-7C72730EE659","title":"Iranian Proud Boys","url":"https:\/\/noagendaartgenerator.com\/artwork\/18244","startTimeInSec":5510.1063569919997,"endTimeInSec":5511.
@normand1
normand1 / owner
Created January 16, 2023 20:10
Example Podcast
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:podcast="https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
<channel>
<title>Podcasting 2.0 Namespace Example</title>
<description>This is a fake show that exists only as an example of the "podcast" namespace tag usage.</description>
<link>http://example.com/podcast</link>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<language>en-US</language>
<generator>Freedom Controller</generator>
<pubDate>Fri, 09 Oct 2020 04:30:38 GMT</pubDate>
@normand1
normand1 / TestPodcastfeed.rss
Last active March 4, 2023 13:04
Test Podcast
<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:anchor="https://anchor.fm/xmlns">
<channel>
<title>HyperCatcher Tutorial - HyperFeed</title>
<description>This is a tutorial podcast for the HyperCatcher Podcast App</description>
<link>https://www.buzzsprout.com/1027057</link>
<image><url>https://d3t3ozftmdmh3i.cloudfront.net/staging/podcast_uploaded_nologo/13998756/d092dfa4735f53e8.jpeg</url>
<title>HyperCatcher Tutorial</title><link>https://www.buzzsprout.com/1027057</link></image>
<generator>Anchor Podcasts</generator>
<lastBuildDate>Sat, 04 Mar 2023 12:30:01 GMT</lastBuildDate>
<atom:link href="https://anchor.fm/s/5408fe90/podcast/rss" rel="self" type="application/rss+xml"></atom:link>
#!/bin/zsh
# Download the RSS feed
curl -s https://feeds.noagendaassets.com/noagenda.xml > rss.xml
# Initialize an empty JSON object
json='{}'
# Iterate over the items in the feed
awk '/<item>/,/<\/item>/' rss.xml | while read -r line; do