Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View typable's full-sized avatar
🛠️
building stuff

Andreas typable

🛠️
building stuff
View GitHub Profile
const STORE_LOG_LEVEL = 'LOG_LEVEL';
const STORE_LOG_MODULE = 'LOG_MODULE';
export enum Level {
Debug = 3,
Info = 2,
Warn = 1,
Error = 0,
}
[init]
defaultBranch = main
[user]
name = typable
email = contact@typable.dev
[alias]
st = status -sb
cm = commit -m
co = checkout
cp = cherry-pick
// [dependencies]
// pico-args = "0.5.0"
// regex = "1.7.0"
use std::io;
use std::io::Read;
use std::io::Write;
use std::net::TcpStream;
use regex::Regex;
#!/bin/bash
if [[ "$1" == "new" ]]; then
if [[ -f ".snip" ]]; then
echo "Not empty dir!"
exit 0
fi
cp -r /d/bin/_snip/* ./
touch .snip
echo "Created a new snip."

Task

2. Network

OSI Reference Model

Layer Function Examples
Application High-level APIs, including resource sharing, remote file access HTTP, WebSocket
Presentation Translation of data between a networking service and an application; including character encoding, data compression and encryption/decryption MIME, SSL, TLS
@typable
typable / terminal-noise.js
Last active November 5, 2021 13:16
Terminal 2D Noise
function base(n) {
return Math.pow(2, n) + 1;
}
function find(x, n) {
let b = 2;
let i = 0;
while(x > b) {
b = base(i + 1);
i++;

SublimeText for ChromeOS

Installation

sudo su
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | apt-key add -
apt-get install apt-transport-https
echo "deb https://download.sublimetext.com/ apt/stable/" | tee /etc/apt/sources.list.d/sublime-text.list
apt-get update
@typable
typable / dns.js
Last active April 28, 2021 15:27
Update Domain IP
import request from './request.js';
const EXTERNAL_IP_SERVICE_URL = 'http://checkip.amazonaws.com';
const DOMAIN_IP_SERVICE_URL = 'https://dns.google.com/resolve';
const DOMAIN_PROVIDER_SERVICE_URL = 'https://dynamicdns.park-your-domain.com';
async function resolve(domain) {
if(typeof domain === 'undefined' || domain.length == 0) {
throw 'Invalid domain argument!';
}
@typable
typable / browser.js
Last active April 28, 2021 15:27
Browser Detection
var Browser = {
type: null,
version: null,
support: function(obj) {
return obj != undefined;
},
is: function(type, version) {
if(type !== Browser.type) {
return false;
}
@typable
typable / openstreetmap.md
Last active April 28, 2021 15:23
Leaflet OSM

OpenStreetMap API

A Leaflet JS implementation to provide Map-Views based on OSM (OpenStreetMap).
Leaflet Docs

Leaflet CDN:

<link rel="stylesheet" href="https://unpkg.com/leaflet@1.4.0/dist/leaflet.css">
<script type="text/javascript" src="https://unpkg.com/leaflet@1.4.0/dist/leaflet.js"></script>