Skip to content

Instantly share code, notes, and snippets.

@apjacob
apjacob / reco.py
Created May 4, 2024 15:53
ReCo Algorithm
import numpy as np
from typing import List
import time
def safelog(x):
"""
Function to safely compute the logarithm of x. If x is less than a very small positive number (EPS),
the logarithm of EPS is returned to avoid division by zero errors.
"""
EPS = 1e-60
@BuonOmo
BuonOmo / emojis.sh
Last active May 6, 2024 14:34
A list of all UTF-8 emojis in bash or zsh
# Obtained with the code written in next file
emoji_grinning_face=😀
emoji_grinning_face_with_big_eyes=😃
emoji_grinning_face_with_smiling_eyes=😄
emoji_beaming_face_with_smiling_eyes=😁
emoji_grinning_squinting_face=😆
emoji_grinning_face_with_sweat=😅
emoji_rolling_on_the_floor_laughing=🤣
emoji_face_with_tears_of_joy=😂
emoji_slightly_smiling_face=🙂
@Ryanb58
Ryanb58 / install.md
Last active May 6, 2024 14:32
How to install telnet into a alpine docker container. This is useful when using the celery remote debugger in a dev environment.
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found

/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
@ih2502mk
ih2502mk / list.md
Last active May 6, 2024 14:31
Quantopian Lectures Saved
@thegitfather
thegitfather / vanilla-js-cheatsheet.md
Last active May 6, 2024 14:31
Vanilla JavaScript Quick Reference / Cheatsheet
@ifyoumakeit
ifyoumakeit / github-conventional-comments.js
Last active May 6, 2024 14:31
GitHub Conventional Comments (instructions to install in comment below code)
(async function generateReplies(document) {
// https://conventionalcomments.org/#labels
const LABEL = {
praise: "praise",
nitpick: "nitpick",
suggestion: "suggestion",
issue: "issue",
todo: "todo",
question: "question",
thought: "thought",
@kilicbaran
kilicbaran / tr-char-eng-layout-mac.md
Created March 1, 2021 12:13
How to type Turkish characters on Mac when using English keyboard layout?

How to type Turkish characters on Mac when using English keyboard layout?

Set the keyboard setting to ABC Extended:

System Preferences -> Keyboard -> Input Sources -> + -> ABC Extended

  • Option-c c: ç
  • Option-c s: ş
  • Option-u u: ü
  • Option-u o: ö
@pauloportella
pauloportella / conventional-comments.md
Last active May 6, 2024 14:30
How to setup conventional comments on Github

Conventional comments

Source

You can add all conventional comments Labels to Github as a saved replies by following the following steps:

  1. Go to https://github.com/settings/replies
  2. Open Developer Tools
  3. Copy/Paste above code in JavaScript console
  4. Press enter
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active May 6, 2024 14:30
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@Overbryd
Overbryd / 0_usage.md
Last active May 6, 2024 14:30
Auto-refreshing XOAuth token system for Google

Usage

Simple as XOauthSession.access_token.

First time usage, either create a yaml file yourself or:

Setup your app at Google developer console. There you follow the menu "APIs & auth" > "Credentials". Click "Create new Client ID" and select "Installed Application" and then "Other". Download oauth2.py and execute the following with the credentials of the Google Developer console.