Skip to content

Instantly share code, notes, and snippets.

View oliverwebr's full-sized avatar
🤷‍♂️

Oliver Weber oliverwebr

🤷‍♂️
  • Berlin
View GitHub Profile
@DavidWells
DavidWells / javascript-proxy-as-rest-client.js
Last active May 12, 2024 14:24
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
// and https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const createApi = (url) => {
return new Proxy({}, {
get(target, key) {
@gricard
gricard / webpack4upgrade.md
Last active February 29, 2024 20:23
Just some notes about my attempt to upgrade to webpack 4

If you enjoyed reading this, I'm intending to do more blogging like this over here: https://cdgd.tech

This is not a complaint about Webpack or v4 in any way. This is just a record of my process trying it out so I could provide feedback to the webpack team

Hmm... I don't see any docs for 4.0 on https://webpack.js.org. I guess I'll just wing it. All I need to do is npm i -D webpack@next, right?

+ webpack@4.0.0-beta.2
@selaromi
selaromi / make-flashlight-work-on.yosemite.md
Last active July 25, 2023 19:21
Steps to make Flashlight work on 10.10.4 (doesn't work for El Capitan)

Make Flashlight work on 10.10.4

  1. Install SIMBL http://culater.net/software/SIMBL/SIMBL.php
  2. Copy SpotlightSIMBL.bundle to /Library/Application Support/SIMBL/Plugins/ (a)
  3. Copy Flashlight.osax to ~/Library/ScriptingAdditions/ (b)
  4. Disable Flashlight
  5. Enable Flashlight
  6. Open Script Editor on your Mac (look for "Script Editor In Spotlight") and paste the following code (don't change Snow Leopard for Yosemite)
tell application "Spotlight" to inject SIMBL into Snow Leopard
@learncodeacademy
learncodeacademy / pubsub.js
Created July 29, 2015 02:54
Basic Javascript PubSub Pattern
//events - a super-basic Javascript (publish subscribe) pattern
var events = {
events: {},
on: function (eventName, fn) {
this.events[eventName] = this.events[eventName] || [];
this.events[eventName].push(fn);
},
off: function(eventName, fn) {
if (this.events[eventName]) {
@sad-pixel
sad-pixel / jsTest.min.sh
Last active August 29, 2015 14:04
jsTest - The One Stop Shop for CDN Benchmarking
#!/bin/bash
function speedTest { local the_speed=$( wget -O /dev/null "http://$1" 2>&1 | awk '/\/dev\/null/ {speed = $3 $4} END {gsub(/\(|\)/,"",speed); print speed}');echo $the_speed;};echo "jsTest.sh by IshanDS www.ishands.cf";echo "";cdnjs=$(speedTest "cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js");echo "Speed from CDNJs: $cdnjs";google=$(speedTest "ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js");echo "Speed from Google CDN: $google";jsdelivr=$(speedTest "cdn.jsdelivr.net/jquery/2.1.1/jquery.min.js");echo "Speed from jsDelivr: $jsdelivr";maxcdn=$(speedTest "oss.maxcdn.com/jquery/2.1.1/jquery.min.js");echo "Speed from MaxCDN: $maxcdn";jquery=$(speedTest "code.jquery.com/jquery-2.1.1.min.js");echo "Speed from Jquery CDN: $jquery";microsoft=$(speedTest "ajax.aspnetcdn.com/ajax/jquery/jquery-2.1.1.min.js");echo "Speed from Microsoft CDN: $microsoft";echo "";echo "Thank you for using jsTest.sh"
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2: