Skip to content

Instantly share code, notes, and snippets.

View phorward's full-sized avatar
🦎
Tokay!

Jan Max Meyer phorward

🦎
Tokay!
View GitHub Profile
@Noah-Huppert
Noah-Huppert / eduroam.config
Created January 29, 2018 06:31
Connman eduroam configuration. On Arch Linux place this file in `/var/lib/connman/eduroam.config`
[service_eduroam]
Type=wifi
Name=eduroam
EAP=peap
CACertFile=/etc/ssl/certs/ca-certificates.crt
Phase2=MSCHAPV2
Identity=<YOUR UNIV. EMAIL>
Passphrase=<YOUR UNIV. LOGIN PASSWORD>
@hijonathan
hijonathan / example.html
Last active February 12, 2024 01:30
Generate a unique id in a Jinja template.
<!-- Jinja Unique ID Generator -->
{% macro random_int(len) -%}
{% for n in range(len) %}
{{ [0,1,2,3,4,5,6,7,8,9]|random }}
{% endfor %}
{%- endmacro %}
{% macro unique_id(count_groups=5, group_len=6, separator='-') -%}
{% set parts %}
@avdg
avdg / es6.ebnf
Last active September 15, 2023 06:04
ES6 bnf grammer - See https://avdg.github.io/es6.xhtml
/* ebnf file for es 6 - MAY CONTAIN ERRORS / DISAMBIGUITY */
Grammer::= Statement
/* Lexical grammer */
SourceCharacter ::= #x0000-#x10FFFF
InputElementDiv ::= WhiteSpace | LineTerminator | Comment | CommonToken | DivPunctuator | RightBracePunctuator
InputElementRegExp ::= WhiteSpace | LineTerminator | Comment | CommonToken | RightBracePunctuator | RegularExpressionLiteral
InputElementRegExpOrTemplateTail ::= WhiteSpace | LineTerminator | Comment | CommonToken | RegularExpressionLiteral | TemplateSubstitutionTail
InputElementTemplateTail ::= WhiteSpace | LineTerminator | Comment | CommonToken | DivPunctuator | TemplateSubstitutionTail
WhiteSpace ::= "<TAB>" | "<VT>" | "<FF>" | "<SP>" | "<NBSP>" | "<ZWNBSP>" | "<USP>"
@Seldaek
Seldaek / sha1hmac.js
Created February 3, 2012 13:37
SHA1 + HMAC in JS
var Crypto = {};
Crypto.sha1_hmac = function (msg, key) {
"use strict";
var oKeyPad, iKeyPad, iPadRes, bytes, i, len;
if (key.length > 64) {
// keys longer than blocksize are shortened
key = Crypto.sha1(key, true);
}