Skip to content

Instantly share code, notes, and snippets.

@chrisbraddock
chrisbraddock / anaconda-clean-base.sh
Created May 2, 2024 18:04
Reset Anaconda / Miniconda Base Environment
# https://stackoverflow.com/a/77768997/227260
CONDA_DIR="$HOME/anaconda3"
CONDA_DIR_BAK="${CONDA_DIR}_bak"
# Miniconda: https://docs.anaconda.com/free/miniconda/miniconda-other-installer-links/
# Anaconda: https://repo.anaconda.com/archive/
CONDA_INSTALL_SHELL="https://repo.anaconda.com/archive/Anaconda3-2024.02-1-Linux-x86_64.sh"
# Check if backup directory exists and move if it does not
@junegunn
junegunn / gist:f4fca918e937e6bf5bad
Last active May 4, 2024 05:07
Browsing git commit history with fzf
# fshow - git commit browser (enter for show, ctrl-d for diff, ` toggles sort)
fshow() {
local out shas sha q k
while out=$(
git log --graph --color=always \
--format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" |
fzf --ansi --multi --no-sort --reverse --query="$q" \
--print-query --expect=ctrl-d --toggle-sort=\`); do
q=$(head -1 <<< "$out")
k=$(head -2 <<< "$out" | tail -1)
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 4, 2024 05:06
set -e, -u, -o, -x pipefail explanation
@bradtraversy
bradtraversy / terminal-commands.md
Last active May 4, 2024 05:05
Common Terminal Commands

Common Terminal Commands

Key Commands & Navigation

Before we look at some common commands, I just want to note a few keyboard commands that are very helpful:

  • Up Arrow: Will show your last command
  • Down Arrow: Will show your next command
  • Tab: Will auto-complete your command
  • Ctrl + L: Will clear the screen
@pythoninthegrass
pythoninthegrass / pull.yml
Created May 4, 2024 04:58
GitHub app Pull
# https://github.com/wei/pull#readme
---
version: "1"
rules:
- base: main
upstream: pythoninthegrass:main
mergeMethod: hardreset # Optional, one of [none, merge, squash, rebase, hardreset], Default: none.
mergeUnstable: false # Optional, merge pull request even when the mergeable_state is not clean. Default: false
@jcarroyo
jcarroyo / client.js
Created April 6, 2016 02:09
Node.js send file with pure socket (low level transfer)
var net = require('net');
var socket = new net.Socket();
socket.connect(5000, "127.0.0.1");
var fs = require('fs');
var path = require('path');
var packets = 0;
var buffer = new Buffer(0);
socket.on('data', function(chunk){
packets++;
@thelissimus
thelissimus / request.ts
Created March 14, 2024 12:30
Effect-TS wrapper for common HTTP method for axios.
import axios, { AxiosRequestConfig } from "axios";
import { Effect as IO, Option, pipe } from "effect";
import { credentials } from "@store/global";
import { BackendPath, UnauthenticatedError, RequestFailedError } from "@common/index";
const Headers = {
Authorization: "Authorization",
RefreshToken: "x-refresh-token",
} as const;
@Pulimet
Pulimet / AdbCommands
Last active May 4, 2024 04:56
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@rgrokett
rgrokett / gist:efa7b99abf7af68823ab59082d9320b7
Last active May 4, 2024 04:55
RTLSDR-Airband instructions for Raspberry Pi 3

RTLSDR-Airband instructions for Raspberry Pi 3

Build a Aircraft scanner from a Pi 3 and an RTL-SDR radio dongle and external audio PC speaker.

Full details are available at https://github.com/szpajder/RTLSDR-Airband/wiki

Hardware

  • Raspberry Pi 3 with at least 2 USB slots
  • RTL-SDR Dongle V3 (typical one, not ADS-B!)
  • USB powered speaker with stereo audio plug
  • Antenna with connecting cable for RTL-SDR dongle
@kyo-takano
kyo-takano / making-the-most-of-local-llms.ipynb
Last active May 4, 2024 04:52
ローカルLLMはこーやって使うの💢
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.