Skip to content

Instantly share code, notes, and snippets.

View floydnoel's full-sized avatar
👨‍💻

Floyd Noel floydnoel

👨‍💻
View GitHub Profile
@scriptpapi
scriptpapi / DocumentPicker.swift
Created April 26, 2021 21:25
Document Picker for SwiftUI
import Foundation
import SwiftUI
import UIKit
struct DocumentPicker: UIViewControllerRepresentable {
@Binding var filePath: URL?
func makeCoordinator() -> DocumentPicker.Coordinator {
return DocumentPicker.Coordinator(parent1: self)
@atomicbird
atomicbird / NSPersistentContainer+extension.swift
Created May 22, 2020 21:39
Back up and restore Core Data persistent stores
//
// NSPersistentContainer+extension.swift
// CDMoveDemo
//
// Created by Tom Harrington on 5/12/20.
// Copyright © 2020 Atomic Bird LLC. All rights reserved.
//
import Foundation
import CoreData
@mattmc3
mattmc3 / modern_sql_style_guide.md
Last active April 8, 2024 22:53
Modern SQL Style Guide
layout author title revision version description
default
mattmc3
Modern SQL Style Guide
2019-01-17
1.0.1
A guide to writing clean, clear, and consistent SQL.

Modern SQL Style Guide

@PaulEibensteiner
PaulEibensteiner / index.html
Last active September 5, 2018 03:49
Custom Editor widget for netlify cms to add shortcode
<!-- Bottom Part of the index.html inside amdmin directory. The UI element is in spanish because of the prject I'm working on right now. Also If you use the id "image"you apparently overwrite the default image widget which you can or cannot want -->
<script>
CMS.registerEditorComponent({
// Internal id of the component
id: "imagen",
// Visible label
label: "Añadir Imagen",
// Fields the user need to fill out when adding an instance of the component
fields: [{name: 'id', label: 'Lugar del Imagen', widget: 'image'}],
const scriptAlreadyLoaded = urlString => Array.prototype.slice.call(document.scripts).filter(s => s.src).map(s => s.src).contains(urlString)
@TimCoates
TimCoates / serverless.yml
Created September 19, 2017 19:04
Building an S3 Origin for Cloudfront in serverless.yml
service: name
custom:
staticBucket: static-name.justtim.net
provider:
name: aws
stage: prod
environment:
bucketName: ${self:custom.staticBucket}
@jwilson8767
jwilson8767 / es6-element-ready.js
Last active April 22, 2024 20:28
Wait for an element to exist. ES6, Promise, MutationObserver
// MIT Licensed
// Author: jwilson8767
/**
* Waits for an element satisfying selector to exist, then resolves promise with the element.
* Useful for resolving race conditions.
*
* @param selector
* @returns {Promise}
*/
@masak
masak / explanation.md
Last active April 11, 2024 02:50
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.