Skip to content

Instantly share code, notes, and snippets.

@eneajaho
eneajaho / config.md
Last active May 3, 2024 10:34
Angular ESLint & Prettier Configuration

Install Angular ESLint

ng add @angular-eslint/schematics

Install Prettier and Prettier-ESLint dependencies

npm install prettier prettier-eslint eslint-config-prettier eslint-plugin-prettier --save-dev

ESLint configuration

Filename: .eslintrc.json

@arikfr
arikfr / refresh.py
Last active May 3, 2024 10:33
Redash Refresh API usage example with parameters Raw
import os
import requests
import time
from pprint import pprint
def poll_job(s, redash_url, job):
# TODO: add timeout
while job['status'] not in (3,4):
response = s.get('{}/api/jobs/{}'.format(redash_url, job['id']))
@mherkazandjian
mherkazandjian / miniconda_installer.sh
Last active May 3, 2024 10:32
miniconda batch/slient web installation wrapper that can be executed also without downloading/saving it to disk
#!/usr/bin/env bash
##################################################
# usage:
# $ ./install_miniconda.sh ~/apps/miniconda
# $ ./install_miniconda.sh ~/apps/miniconda --mamba
# $ ./install_miniconda.sh ~/apps/miniconda --installer latest
# $ ./install_miniconda.sh ~/apps/miniconda --upgrade --mamba
# $ ./install_miniconda.sh ~/apps/miniconda --installer latest --upgrade --mamba
# $ ./install_miniconda.sh ~/apps/miniconda --installer Miniconda3-py310_23.5.1-0-Linux-x86_64.sh --upgrade --mamba
@ChathuraHettiarachchi
ChathuraHettiarachchi / MotionLayoutTry.kt
Last active May 3, 2024 10:31
This is a sample implementation of AirBnB search bar transition on Android usin Jetpack Compose MotionLayout, MotionScene with DSL. You need to replace the images on `destinations` to work this. FInd the video link https://twitter.com/i/status/1778640663086829622
package com.chootadev.composetryout
import androidx.annotation.DrawableRes
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.keyframes
import androidx.compose.animation.core.tween
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
@madduci
madduci / ftth_openwrt.md
Last active May 3, 2024 10:29
Deutsche Telekom FTTH Access with OpenWRT

Configuring Deutsche Telekom FTTH Access with OpenWRT

After looking for alternatves to the suggested Router from Telekom (AVM FritzBox and HUawei Speedport), I've discovered the possibility of configuring my existing OpenWRT Router to act as gateway to the Telekom FTTH (Fiber To The Home) Magenta Zuhause package.

TL;DR

The WAN interface must be configured as follows (see your Telekom letter):

  • Protocol: PPPoE
  • PAP/CHAP username:
@longdog
longdog / history.ts
Created November 19, 2021 19:03
react-router 6 and effector
import { createBrowserHistory } from "history";
export const browserHistory = createBrowserHistory();
@sloanlance
sloanlance / jq_jsonl_conversion.md
Last active May 3, 2024 10:26
jq: JSONL ↔︎ JSON conversion

jq: JSONL ↔︎ JSON conversion

Prerequisites

  • jqhttps://jqlang.github.io/jq/ — "like sed for JSON data"

    There are several options available for installing jq. I prefer to use Homebrew: brew install jq

  1. JSONL → JSON

@shigenobuokamoto
shigenobuokamoto / network-mirrored.service
Last active May 3, 2024 10:25
/etc/systemd/system/network-mirrored.service
[Unit]
Wants=network-pre.target
Before=network-pre.target shutdown.target
[Service]
User=root
ExecStart=/bin/sh -ec '\
[ -x /usr/bin/wslinfo ] && [ "$(/usr/bin/wslinfo --networking-mode)" = "mirrored" ] || exit 0;\
echo "\
add chain ip nat WSLPREROUTING { type nat hook prerouting priority dstnat - 1; policy accept; };\
@adammyhre
adammyhre / AbilitySystem.cs
Last active May 3, 2024 10:24
MVC Ability System
[CreateAssetMenu(fileName = "AbilityData", menuName = "ScriptableObjects/AbilityData", order = 1)]
public class AbilityData : ScriptableObject {
public AnimationClip animationClip;
public int animationHash;
public float duration;
public Sprite icon;
public string fullName;
void OnValidate() {
@guwidoe
guwidoe / GetLocalOneDrivePath.bas.vb
Last active May 3, 2024 10:23
VBA Function to get the local path of a OneDrive/SharePoint synchronized Microsoft Office file
'Attribute VB_Name = "GetLocalOneDrivePath"
'
' Cross-platform VBA Function to get the local path of OneDrive/SharePoint
' synchronized Microsoft Office files (Works on Windows and on macOS)
'
' Author: Guido Witt-Dörring
' Created: 2022/07/01
' Updated: 2024/04/23
' License: MIT
'