Skip to content

Instantly share code, notes, and snippets.

View adambabik's full-sized avatar

Adam Babik adambabik

View GitHub Profile
@qdm12
qdm12 / README.md
Last active October 29, 2024 23:50
Wireguard and iptables restrictions for multiple users

Wireguard and iptables restrictions for multiple users

If you don't know what Wireguard is, well, you should. It's fast, easy to setup and highly configurable. We will configure Wireguard for multiple users with various restrictions using iptables.

Assumptions

This should fit most setups (not mine though 😉)

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active November 6, 2024 16:18
set -e, -u, -o, -x pipefail explanation
@ericelliott
ericelliott / essential-javascript-links.md
Last active October 4, 2024 20:52
Essential JavaScript Links
@leonderijke
leonderijke / svgfixer.js
Last active June 17, 2024 07:57
Fixes references to inline SVG elements when the <base> tag is in use.
/**
* SVG Fixer
*
* Fixes references to inline SVG elements when the <base> tag is in use.
* Firefox won't display SVG icons referenced with
* `<svg><use xlink:href="#id-of-icon-def"></use></svg>` when the <base> tag is on the page.
*
* More info:
* - http://stackoverflow.com/a/18265336/796152
* - http://www.w3.org/TR/SVG/linking.html
@elithrar
elithrar / gocraftweb.go
Last active December 13, 2018 16:39
HTTP Request Contexts in Go — Examples — http://elithrar.github.io/article/map-string-interface/
package main
import (
"fmt"
"log"
"net/http"
"github.com/gocraft/web"
)
@staltz
staltz / introrx.md
Last active November 7, 2024 13:05
The introduction to Reactive Programming you've been missing
@cryptix
cryptix / LICENSE
Last active June 26, 2024 01:30
example of using JWT for http authentication in go
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE S
@sstur
sstur / html-parser.js
Last active February 9, 2017 19:09
Pure JS HTML Parser (ported from CKEditor 4.2)
/*!
* HTML Parser
* Ported from CKEditor 4.2 (f74e558351)
*
*/
/*global require, exports, module, define */
var HTMLParser;
(function(definition) {
if (typeof exports == 'object' && typeof module == 'object') {
// CommonJS/Node
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@WebReflection
WebReflection / gist:6225242
Created August 13, 2013 20:16
serializing RegExp
/o/.toJSON || (RegExp.prototype.toJSON = function () {
return [
this.source,
(this.global ? "g" : "") +
(this.ignoreCase ? "i" : "") +
(this.multiline ? "m" : "")
];
});
var re = /test/g;
alert(RegExp.apply(null, JSON.parse(JSON.stringify(re))));