Skip to content

Instantly share code, notes, and snippets.

View squarefrog's full-sized avatar
😍
❤️ Swift

Paul Williamson squarefrog

😍
❤️ Swift
  • Cambridgeshire, UK
View GitHub Profile
@subdigital
subdigital / radars.txt
Last active December 6, 2022 09:29
Xcode Vim Radars
These are feedbacks I've filed against Xcode 13's Vim support. Please dupe!
Vim mode needs option to turn off audible bell - FB9136734
Vim mode needs option to disable/hide help bar - FB9138240
Vim mode needs CTRL+SHIFT+V columnar select mode - FB9138552
Vim mode missing macros for repeated text operations - FB9138595
Vim mode - support for plugins? - FB9138670
Vim mode - :w should save the file - FB9138695
Vim mode - shift-V doesn’t correctly select the first full line - FB9138796
Vim mode - Allow repeated editing operations with “.” - FB9154817
@zntfdr
zntfdr / firebase-iOS-breakdown.swift
Last active July 4, 2024 09:35
Firebase iOS Version breakdown
// How to:
// 1. Open the Firebase Analytics Dashboard
// 2. Scroll to bottom, where you see the "Users by Device model" widget
// 3. Click "View device models" in that widget (this opens the "Tech details" Firebase Analytics page)
// 4. Above the table shown in the new page, click on the “Device model” drop down menu and select “OS with Version”
// 5. Make sure to select “OS with version” and not “OS Version”
// 6. On the top right corner of the page, click on the “Share this report” icon (next to the date)
// 7. Click “Download file” on the new side bar, then “Download CSV"
// 8. Open the file and select the iOS/Android breakdown raw data
// 9. Replace the sample data in this script with your data
@chriseidhof
chriseidhof / collectionview.swift
Last active January 31, 2024 19:00
SwiftUI Flow Layout
//
// ContentView.swift
// DeleteMe
//
// Created by Chris Eidhof on 02.02.21.
//
import SwiftUI
/*
@loilo
loilo / split-pull-requests.md
Last active April 3, 2024 07:24
Split a large pull request into two
@pvieito
pvieito / iTunes.swift
Created June 23, 2016 14:30
iTunes ScriptingBridge header
//
// iTunes.swift
//
import AppKit
import ScriptingBridge
// MARK: Enum Definitions -
@objc enum iTunesEKnd: NSInteger {
@JaviSoto
JaviSoto / Example.swift
Last active July 17, 2017 06:16
TableSectionDataDiffing
var sections: [MySectionType] {
didSet {
let operations = TableSectionDataDiffing.tableOperationsToUpdateFromSections(sections: oldValue, toSections: sections)
self.tableView.applyTableOperations(operations, withAnimations: updateAnimations)}
}
}
@JamesMessinger
JamesMessinger / README.md
Last active March 9, 2024 17:58
VSCode GitHub Markdown Theme

GitHub Markdown Theme for Visual Studio Code

This CSS stylesheet allows you to preview markdown files in VSCode using GitHub's mardown theme. This CSS was taken directly from the official GitHub Markdown repo. I replaced their top-level .markdown-body class with the body tag so it would work in VSCode, and added styling for the html tag to match GitHub's fixed-width container.

Instructions

  1. Copy the CSS file to your computer
    Copy the github-markdown.css file below to your computer. You can put it anywhere you want, but I chose to put it in the same folder as my VSCode settings file.

  2. Edit your VSCode settings
    If you want to use this theme for all of your projects, then edit your User Settings file. If you just want to use this them

@mwaterfall
mwaterfall / StringExtensionHTML.swift
Last active May 27, 2024 04:36
Decoding HTML Entities in Swift
// Very slightly adapted from http://stackoverflow.com/a/30141700/106244
// 99.99% Credit to Martin R!
// Mapping from XML/HTML character entity reference to character
// From http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
private let characterEntities : [String: Character] = [
// XML predefined entities:
""" : "\"",
"&" : "&",
//
// NocillaTestCase.swift
//
// Copyright (c) 2014 Witold Skibniewski
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@tauzen
tauzen / hexstring.js
Last active July 31, 2023 00:06
Hex string to byte and other way round conversion functions.
function byteToHexString(uint8arr) {
if (!uint8arr) {
return '';
}
var hexStr = '';
for (var i = 0; i < uint8arr.length; i++) {
var hex = (uint8arr[i] & 0xff).toString(16);
hex = (hex.length === 1) ? '0' + hex : hex;
hexStr += hex;