Skip to content

Instantly share code, notes, and snippets.

View Pocket-titan's full-sized avatar
Need coffee

Jelmar Gerritsen Pocket-titan

Need coffee
View GitHub Profile
@mtreviso
mtreviso / psinfo.py
Created March 18, 2024 05:12
Pretty Print for Slurm `sinfo`. It uses [rich](https://github.com/Textualize/rich). You can install it globally via `sudo pip install rich`.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""psinfo.py
This script displays sinfo in a pretty table.
"""
import platform
import subprocess
import sys
try:

Alias eza for ls command

Put to shell configure file

first install eza by homebrew

brew install eza

Basic setup

@sneakers-the-rat
sneakers-the-rat / clean_pdf.sh
Last active February 10, 2025 18:41
Strip PDF Metadata
# --------------------------------------------------------------------
# Recursively find pdfs from the directory given as the first argument,
# otherwise search the current directory.
# Use exiftool and qpdf (both must be installed and locatable on $PATH)
# to strip all top-level metadata from PDFs.
#
# Note - This only removes file-level metadata, not any metadata
# in embedded images, etc.
#
# Code is provided as-is, I take no responsibility for its use,
@everdaniel
everdaniel / install_wrf41.sh
Created February 24, 2021 21:31 — forked from jamal919/install_wrf41.sh
WRF 4.1.2 installation with netCDF4, HDF5 in ubuntu 18.04 LTS
#!/bin/bash
## WRF installation with parallel process.
# Download and install required library and data files for WRF.
# License: LGPL
# Jamal Khan <[email protected]>
# Tested in Ubuntu 18.04 LTS
# basic package managment
sudo apt update
sudo apt upgrade
@dkirkby
dkirkby / jupyter notebook preamble
Last active February 17, 2021 19:07
Useful bits for a jupyter notebook preamble
%reload_ext autoreload
%autoreload 1
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
# Modules imported by devpkg must also be listed here to get the same treatment.
%aimport devpkg
%aimport devpkg.util
@threepointone
threepointone / for-snook.md
Last active December 3, 2024 21:48
For Snook

https://twitter.com/snookca/status/1073299331262889984?s=21

‪“‬In what way is JS any more maintainable than CSS? How does writing CSS in JS make it any more maintainable?”

‪Happy to chat about this. There’s an obvious disclaimer that there’s a cost to css-in-js solutions, but that cost is paid specifically for the benefits it brings; as such it’s useful for some usecases, and not meant as a replacement for all workflows. ‬

‪(These conversations always get heated on twitter, so please believe that I’m here to converse, not to convince. In return, I promise to listen to you too and change my opinions; I’ve had mad respect for you for years and would consider your feedback a gift. Also, some of the stuff I’m writing might seem obvious to you; I’m not trying to tell you if all people of some of the details, but it might be useful to someone else who bumps into this who doesn’t have context)‬

So the big deal about css-in-js (cij) is selectors.

//
// Author: Jonathan Blow
// Version: 1
// Date: 31 August, 2018
//
// This code is released under the MIT license, which you can find at
//
// https://opensource.org/licenses/MIT
//
//
@0xjac
0xjac / private_fork.md
Last active July 7, 2025 10:00
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@zeffii
zeffii / easing_p.py
Created August 23, 2016 07:35
easing functions python
from math import sqrt, pow, sin, cos
from math import pi as M_PI
M_PI_2 = M_PI * 2
'''
original c code:
https://raw.githubusercontent.com/warrenm/AHEasing/master/AHEasing/easing.c
Copyright (c) 2011, Auerhaus Development, LLC
http://sam.zoy.org/wtfpl/COPYING for more details.
'''