Skip to content

Instantly share code, notes, and snippets.

View csvan's full-sized avatar

Christopher Svanefalk csvan

View GitHub Profile
@joepie91
joepie91 / es-modules-are-terrible-actually.md
Last active April 14, 2024 04:25
ES Modules are terrible, actually

ES Modules are terrible, actually

This post was adapted from an earlier Twitter thread.

It's incredible how many collective developer hours have been wasted on pushing through the turd that is ES Modules (often mistakenly called "ES6 Modules"). Causing a big ecosystem divide and massive tooling support issues, for... well, no reason, really. There are no actual advantages to it. At all.

It looks shiny and new and some libraries use it in their documentation without any explanation, so people assume that it's the new thing that must be used. And then I end up having to explain to them why, unlike CommonJS, it doesn't actually work everywhere yet, and may never do so. For example, you can't import ESM modules from a CommonJS file! (Update: I've released a module that works around this issue.)

And then there's Rollup, which apparently requires ESM to be u

@gerbsen
gerbsen / ssh_agent_start.fish
Last active January 26, 2024 08:13 — forked from schaary/ssh_agent_start.fish
Auto-launching ssh-agent in fish shell
# content has to be in .config/fish/config.fish
# if it does not exist, create the file
setenv SSH_ENV $HOME/.ssh/environment
function start_agent
echo "Initializing new SSH agent ..."
ssh-agent -c | sed 's/^echo/#echo/' > $SSH_ENV
echo "succeeded"
chmod 600 $SSH_ENV
. $SSH_ENV > /dev/null
@justinmc
justinmc / anchor_smooth_scroll.js
Last active May 14, 2019 19:52
Anchor Smooth Scroll - Angular Directive
/**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Anchor Smooth Scroll - Smooth scroll to the given anchor on click
* adapted from this stackoverflow answer: http://stackoverflow.com/a/21918502/257494
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
angular.module('yourapp').directive('anchorSmoothScroll', function($location) {
'use strict';
return {
restrict: 'A',
replace: false,
@thomasfr
thomasfr / iptables.sh
Last active April 13, 2024 01:59
iptable rules to allow outgoing DNS lookups, outgoing icmp (ping) requests, outgoing connections to configured package servers, outgoing connections to all ips on port 22, all incoming connections to port 22, 80 and 443 and everything on localhost
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER="8.8.4.4 8.8.8.8"
# Allow connections to this package servers
@mschmulen
mschmulen / README.md
Last active August 23, 2022 22:42 — forked from anonymous/README.md
LoopBack cheat sheet. git clone https://gist.github.com/6740321.git LoopBackCheatSheet

#LoopBack cheat sheet

##Recipies

LoopBack from api-example

Instantiate the sls-sample-app

slc example
cd sls-sample-app
slc install