Currently only works if course content is visible, and course section(s) is/are already expanded.
Open console for web browser (F12 or Right-Click Inspect) Paste the section of JavaScript below into the console according to your needs.
| #!/bin/bash | |
| git status -s | |
| read -p "Press any key to show diff" -n1 -s; echo | |
| git --no-pager diff | |
| read -p "Press any key to stage all files" -n1 -s; echo | |
| git add . | |
| git status -s |
| {lib, ...}: { | |
| toBase64 = text: let | |
| inherit (lib) sublist mod stringToCharacters concatMapStrings; | |
| inherit (lib.strings) charToInt; | |
| inherit (builtins) substring foldl' genList elemAt length concatStringsSep stringLength; | |
| lookup = stringToCharacters "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | |
| sliceN = size: list: n: sublist (n * size) size list; | |
| pows = [(64 * 64 * 64) (64 * 64) 64 1]; | |
| intSextets = i: map (j: mod (i / j) 64) pows; | |
| compose = f: g: x: f (g x); |
Currently only works if course content is visible, and course section(s) is/are already expanded.
Open console for web browser (F12 or Right-Click Inspect) Paste the section of JavaScript below into the console according to your needs.
| import os | |
| import time | |
| import re | |
| import subprocess | |
| from watchdog.observers import Observer | |
| from watchdog.events import FileSystemEventHandler | |
| def get_relative_path(path): | |
| return os.path.relpath(path) |
| # Run the last command as root | |
| sudo !! | |
| # Serve current directory tree at http://$HOSTNAME:8000/ | |
| python -m SimpleHTTPServer | |
| # Save a file you edited in vim without the needed permissions | |
| :w !sudo tee % | |
| # change to the previous working directory | |
| cd - | |
| # Runs previous command but replacing | |
| ^foo^bar |
| import jenkins.* | |
| import hudson.* | |
| import com.cloudbees.plugins.credentials.* | |
| import com.cloudbees.plugins.credentials.common.* | |
| import com.cloudbees.plugins.credentials.domains.* | |
| import com.cloudbees.jenkins.plugins.sshcredentials.impl.* | |
| import hudson.plugins.sshslaves.*; | |
| import hudson.model.* | |
| import jenkins.model.* | |
| import hudson.security.* |
| To add a GPG Public key | |
| sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 1AD28806 |
| #!/usr/bin/env python3 | |
| from os import path | |
| import tempfile | |
| import subprocess | |
| import datetime as dt | |
| import click | |
| @click.group() | |
| def cli(): |
| Export a key to GPG or ASCII format | |
| gpg --export YOUR_FINGERPRINT > pubkey.gpg | |
| gpg --armor --export YOUR_FINGERPRINT > pubkey.asc | |
| Convert a key/file to/from GPG or ASCII format | |
| gpg --enarmor file.gpg > file.asc | |
| gpg --dearmor file.asc > file.gpg |
We need to generate a unique SSH key for our second GitHub account.
ssh-keygen -t rsa -C "your-email-address"
Be careful that you don't over-write your existing key for your personal account. Instead, when prompted, save the file as id_rsa_COMPANY. In my case, I've saved the file to ~/.ssh/id_rsa_work.