Skip to content

Instantly share code, notes, and snippets.


Floyd Noel floydnoel

View GitHub Profile
floydnoel / NoteField.swift
Created Jul 11, 2021
A TextEditor component with a placeholder
View NoteField.swift
// NoteField.swift
// Created by Floyd Noel on 7/11/21.
import SwiftUI
struct NoteField: View {
var label: String
View getSearchParams.js
const getSearchParams = () =>
.reduce((acc, searchParam) => {
const [name, value] = searchParam.split('=');
return { ...acc, [name]: value };
}, {});
floydnoel / forgetAboutCors.js
Last active Apr 30, 2018
CORS problem? forget about it!
View forgetAboutCors.js
// takes a string URL, and returns a string URL which allows the request to proceed without CORS blocking
const forgetAboutCors = u => `${u}`
// example usage: forgetAboutCors(`${'NCT03512561'}?displayxml=true`)
View scriptAlreadyLoaded.js
const scriptAlreadyLoaded = urlString => => s.src).map(s => s.src).contains(urlString)
floydnoel /
Last active Jul 27, 2022
Remove all files from a Git repo based on the .gitignore file
echo "Cleaning up any git ignored files..."
# copy and paste the line below to get the same results as running this script
git rm --cached `git ls-files -ic --exclude-from=.gitignore`
echo "Finished clean up."
# source: