Skip to content

Instantly share code, notes, and snippets.

View jsr-p's full-sized avatar
🎯
Focusing

jsr-p

🎯
Focusing
View GitHub Profile
@cecepm
cecepm / install_cheat.md
Last active February 28, 2022 18:24
Install Cheat
  1. Download cheat
    curl -sL https://github.com/cheat/cheat/releases/download/4.2.2/cheat-linux-amd64.gz -o ~/cheat-linux-amd64.gz
    
  2. Extract
    gzip -d ~/cheat-linux-amd64.gz
    
  3. Copy cheat binary to /usr/local/bin
@aanari
aanari / set-alacritty-default.sh
Last active October 16, 2024 18:35
Set Alacritty as Default Terminal Editor (Ubuntu)
sudo update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator $(which alacritty) 50
sudo update-alternatives --config x-terminal-emulator
@Aaronmacaron
Aaronmacaron / install-alacritty-ubuntu.sh
Last active October 10, 2022 11:26
Install Alacritty on Ubuntu
#!/bin/bash
# This installs alacritty terminal on ubuntu (https://github.com/jwilm/alacritty)
# You have to have rust/cargo installed for this to work
# Install required tools
sudo apt-get install -y cmake libfreetype6-dev libfontconfig1-dev xclip
# Download, compile and install Alacritty
git clone https://github.com/jwilm/alacritty
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@ergoithz
ergoithz / xpath_soup.py
Last active October 11, 2024 03:23
Generate unique XPATH for BeautifulSoup element
#!/usr/bin/python
# -*- coding: utf-8 -*-
import bs4
def xpath_soup(element):
# type: (typing.Union[bs4.element.Tag, bs4.element.NavigableString]) -> str
"""
Generate xpath from BeautifulSoup4 element.