Skip to content

Instantly share code, notes, and snippets.

View individual11's full-sized avatar
๐ŸŽƒ
2026

David Vogeleer individual11

๐ŸŽƒ
2026
View GitHub Profile
@individual11
individual11 / javascript-proxy-as-rest-client.js
Created February 8, 2022 21:11 — forked from DavidWells/javascript-proxy-as-rest-client.js
Using a javascript proxy as low code REST client
/* Using a JavaScript proxy for a super low code REST client */
// via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg
// also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3
// also see https://github.com/fastify/manifetch
// also see https://github.com/flash-oss/allserver
const createApi = (url) => {
return new Proxy({}, {
get(target, key) {
return async function(id = "") {
const response = await fetch(`${url}/${key}/${id}`)
extension UIView {
func addSubviews(views:UIView...){
for view in views {
self.addSubview(view)
}
}
}
//Use
myCurrentView.addSubviews(anotherView, aRandomView, yetAnotherView)
@individual11
individual11 / functionalTest.playground
Created September 4, 2014 18:43
Trying to understand Functional Programming in Swift
//create a type for the functions we are creating
typealias Math = Int -> Int
func toThePowerOf(power:Int)->Math{
return { num in
var cur = num;
for _ in 1..<power {
cur *= num
}
return cur
@individual11
individual11 / server.js
Last active January 1, 2016 21:39
If you want to see what all the font options look like in figlet
/**********************
*
* run this in command line first
* $ npm install figlet
*
**********************/
var figlet = require('figlet');
figlet.fonts(function(err, fonts) {