Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Close Confirmation</title>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
@slangley
slangley / screenshot_index.py
Created December 7, 2024 03:27
Script to Download iOS AppStore screenshots to an Index sheet.
# requests>=2.31.0
# beautifulsoup4>=4.12.0
# Pillow>=10.0.0
# urllib3<2.0.0
import requests
from bs4 import BeautifulSoup
@slangley
slangley / AssertUnwrap.swift
Created September 17, 2020 14:34 — forked from preble/AssertUnwrap.swift
This is Nate's idea, something I use on every project. Sometimes you need to accommodate an optional that shouldn't be optional.
public extension Optional {
/// Stop in the debugger in debug builds if self is `.none`.
///
/// Example usage:
///
/// guard let value = maybeValue.assertUnwrap() else { return "bogus value" }
///
func assertUnwrap(_ message: @autoclosure () -> String? = nil, file: StaticString = #file, function: String = #function, line: UInt = #line) -> Wrapped? {
switch self {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@slangley
slangley / API.md
Created January 15, 2020 17:34 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@slangley
slangley / nginx-environment.md
Created May 4, 2019 01:04 — forked from xaviervia/nginx-environment.md
Nginx and Docker links with environment variables, a love story

How to add environment variables to nginx.conf

This is the hack approach to adding environment variables to the nginx configuration files. As with most Google results for this search, the reason is Docker.

The setup

I intended to deploy two Docker containers.

import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var rootVC: UINavigationController? = nil
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
@slangley
slangley / app-1.spec.ts
Created December 6, 2016 20:21 — forked from wkwiatek/app-1.spec.ts
Angular 2 test snippets for Angular final version. Codebase for https://developers.livechatinc.com/blog/category/programming/angular-2/
// App
import { Component } from '@angular/core';
@Component({
selector: 'app',
template: '<span>{{ sayHello() }}</span>',
})
export class App {
public name: string = 'John';
@slangley
slangley / UIButton+Rx.swift
Created September 25, 2015 19:55
RxSwift UIButton binding for setImage:controlState:
import UIKit
import RxSwift
import RxCocoa
extension UIButton {
public func rx_image(controlState: UIControlState?) -> ObserverOf<UIImage!> {
return ObserverOf { [weak self] event in
MainScheduler.ensureExecutingOnScheduler()
@slangley
slangley / runSBConstants.sh
Created September 17, 2015 14:48
Wrapper around SBConstants that warns if not installed.
#!/bin/bash
SWIFT_ARGS=
while getopts w opt; do
case $opt in
w)
SWIFT_ARGS='-w'
;;
esac