Skip to content

Instantly share code, notes, and snippets.

View NicoWeio's full-sized avatar

Nicolai Weitkemper NicoWeio

View GitHub Profile
@chrismeyersfsu
chrismeyersfsu / blink_ip.pl
Created June 2, 2012 15:27
Raspberry Pi Blink Ip Address
@m14t
m14t / fix_github_https_repo.sh
Created July 5, 2012 21:57
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi
@jedfoster
jedfoster / .gitignore
Last active February 28, 2025 14:33
JavaScript version of Sass' mix() function
package-lock.json
@AugustMiller
AugustMiller / map.js
Last active October 2, 2021 14:14
Map a number in one range to a number in another.
function mapNumber (number, inMin, inMax, outMin, outMax) {
return (number - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
}
@pankajp
pankajp / serve_http.py
Last active October 19, 2024 11:58
Simple Python HTTP Server with multi-threading and partial-content support
#! /usr/bin/env python
# Standard library imports.
from SocketServer import ThreadingMixIn
import BaseHTTPServer
import SimpleHTTPServer
import sys
import json
import os
from os.path import (join, exists, dirname, abspath, isabs, sep, walk, splitext,
@fgilio
fgilio / axios-catch-error.js
Last active June 18, 2025 11:09
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active June 15, 2025 17:17
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active June 17, 2025 00:32
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

@indrekj
indrekj / truenas-kubectl.md
Last active March 21, 2025 03:25
How to acccess TrueNAS kubectl remotely?

How to acccess TrueNAS kubectl remotely from your local computer?

DISCLAIMER: This is an unofficial guide. If you mess things up then you may lock yourself out of TrueNAS or even worse, make it unusable. There's also no guarantee that this works in the future.

Through SSH

Currently the easiest way to access kubectl is through ssh and k3s tool. If you have ssh access enabled then you can ssh to your TrueNAS server and use it

@OmkarKirpan
OmkarKirpan / SCORM_cheat.js
Created March 1, 2023 19:53
SCORM LMS Hack
let ok = SCORM_GetAPI()
// setting lesson_status
ok.LMSSetValue('cmi.core.lesson_status', 'completed')
ok.LMSGetValue('cmi.core.lesson_status')
// setting score
ok.LMSSetValue('cmi.core.score.raw', '100')
ok.LMSGetValue('cmi.core.score.raw')
// Saving
ok.LMSCommit()
ok.LMSFinish()