Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
@brandon1024
brandon1024 / GITCRASHCOURSE.MD
Last active March 28, 2024 11:18
Git Crash Course for Beginners

Git Crash Course for Beginners

Preface

A good understanding of Git is an incredibly valuable tool for anyone working amongst a group on a single project. At first, learning how to use Git will appear quite complicated and difficult to grasp, but it is actually quite simple and easy to understand.

Git is a version control system that allows multiple developers to contribute to a project simultaneously. It is a command-line application with a set of commands to manipulate commits and branches (explained below). This tutorial will help you get started, and in no time you will be a Git Ninja!

Contents:

@shagunsodhani
shagunsodhani / Memory Networks.md
Last active March 28, 2024 11:17
Notes for "Memory Networks" paper

Memory Networks

Introduction

  • Memory Networks combine inference components with a long-term memory component.
  • Used in the context of Question Answering (QA) with memory component acting as a (dynamic) knowledge base.
  • Link to the paper.

Related Work

@etoxin
etoxin / SSH over USB on a Raspberry Pi.md
Last active March 28, 2024 11:16
SSH over USB on a Raspberry Pi

Our long term goal will be to use SSH over USB. This means that we have to configure Raspbian to treat the USB port like an ethernet port. Mount the micro SD card in a computer (not Pi Zero) and open it with Finder, or Windows Explorer, or whatever it is that you use.

The first thing that you want to do is open a file at the root of the mounted drive called config.txt. In this file you want to add the following line at the very bottom:

dtoverlay=dwc2

The above line will set us up for the next file that we alter. The next file we alter is cmdline.txt, but it is a bit different. Parameters in this file are not delimited by new lines or commas, they are delimited by space characters. In this file we want to add the following:

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active March 28, 2024 11:13
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@yayanet
yayanet / rules.yaml
Last active March 28, 2024 11:09
clash rules
# <-- custom start
- DOMAIN-SUFFIX,youdao.com,DIRECT
- DOMAIN-SUFFIX,hillinsight.tech,DIRECT
- DOMAIN-SUFFIX,sentry.io,DIRECT
- DOMAIN-SUFFIX,ifconfig.io,Proxy
- DOMAIN-SUFFIX,github.com,Proxy
- DOMAIN-SUFFIX,dlercloud.com,Proxy
- DOMAIN-SUFFIX,dler.io,Proxy
- DOMAIN-SUFFIX,m-team.cc,Proxy
# Google
@mjambon
mjambon / parallel
Last active March 28, 2024 11:09
bash: Run parallel commands and fail if any of them fails
#! /usr/bin/env bash
#
# Run parallel commands and fail if any of them fails.
#
set -eu
pids=()
for x in 1 2 3; do
@vkhorikov
vkhorikov / CustomerController.cs
Last active March 28, 2024 11:09
Handling failures and input errors in a functional way
[HttpPost]
public HttpResponseMessage CreateCustomer(string name, string billingInfo)
{
Result<BillingInfo> billingInfoResult = BillingInfo.Create(billingInfo);
Result<CustomerName> customerNameResult = CustomerName.Create(name);
return Result.Combine(billingInfoResult, customerNameResult)
.OnSuccess(() => _paymentGateway.ChargeCommission(billingInfoResult.Value))
.OnSuccess(() => new Customer(customerNameResult.Value))
.OnSuccess(
@dvf
dvf / change-codec.md
Last active March 28, 2024 11:08
Enable High Quality mode on your headphones (Updated for macOS Catalina)

If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.

Find out what codec you're using

  1. Play a song on your headphones
  2. Option (⌥) click the Bluetooth button at the top of your screen Inspect the Bluetooth Coded
  3. If you're using AAC or aptX, you can stop here—those are the highest quality codecs.

Change your codec to AAC or aptX

@david-sanabria
david-sanabria / pg_base62_encode.sql
Last active March 28, 2024 11:08
Base62 Encode/Decode functions for PostgreSQL.
/*
* This script will create base62_encode() and base62_decode() in the current schema of a postgresql database.
* Give it a star if you find it useful.
*/
CREATE OR REPLACE FUNCTION base62_encode( long_number bigint )
RETURNS text
AS $BODY$
/*
* base62_encode()