Skip to content

Instantly share code, notes, and snippets.

@aadm
aadm / example_plot3dseis.py
Last active May 9, 2024 14:10
Python function to plot inline, crossline or horizontal slice from 3D seismic volume. Also included example showing how to load a 3D cube and display it.
import numpy as np
import matplotlib.pyplot as plt
import time
from obspy.io.segy.segy import _read_segy
# sample 3d cube from GOM, download here:
# https://walrus.wr.usgs.gov/namss/survey/b-05-88-la/
filename='G3D1304_005_L88_056_LN_1664-3428.sgy'
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@riggaroo
riggaroo / GraphicsBlend.kt
Created May 9, 2024 11:57
GraphicsLayer APIs - BlendMode per layer
@Preview
@Composable
private fun GraphicsLayerBlurBackground() {
Box(modifier = Modifier
.fillMaxSize()){
Image(
painter = painterResource(id = R.drawable.sunset),
contentDescription = null
)
val graphicsLayer2 = rememberGraphicsLayer()
@redguardtoo
redguardtoo / .emacs
Last active May 9, 2024 14:09
minimum emacs setup for Emacs plugin testing
;; A minimum .emacs to test Emacs plugins
(show-paren-mode 1)
(eval-when-compile (require 'cl))
;; test elisps download from internet here
(setq test-elisp-dir "~/test-elisp/")
(unless (file-exists-p (expand-file-name test-elisp-dir))
(make-directory (expand-file-name test-elisp-dir)))
(setq load-path
@ryukinix
ryukinix / find-executable.lisp
Last active May 9, 2024 14:08
find-executable in Common Lisp
(defun executables ()
(loop with path = (uiop:getenv "PATH")
for p in (uiop:split-string path :separator ":")
for dir = (probe-file p)
when (uiop:directory-exists-p dir)
append (uiop:directory-files dir)))
(defun find-executable (name)
(find name (executables)
:test #'equalp
@darrenpmeyer
darrenpmeyer / README.md
Created November 20, 2020 19:35
Automatically start a single instance of ssh-agent for all terminal sessions to share (bash)

Installation

  1. mkdir -p ~/.config && touch ~/.config/ssh-agent.pid
  2. Paste the contents of ssh-agent-manage.sh into your .bashrc or .bash_profile or similar
  3. killall -9 ssh-agent
  4. Start a new terminal session (note: old sessions will not see ssh-agent, only new ones)

Details

This snippet, when included in .bashrc, will ensure that your session has a working ssh-agent with all your ssh keys loaded into it. It does this without creating separate ssh-agent processes by:

@probonopd
probonopd / Wayland.md
Last active May 9, 2024 14:04
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

Wayland proponents make it seem like Wayland is "the successor" of Xorg, when in fact it is not. It is merely an incompatible alternative, and not even one that has (nor wants to have) feature parity (missing features). And unlike X11 (the X Window System), Wayland protocol designers actively avoid the concept of "windows" (making up incompr

@bradtraversy
bradtraversy / tailwind-webpack-setup.md
Last active May 9, 2024 14:03
Setup Webpack with Tailwind CSS

Webpack & Tailwind CSS Setup

Create your package.json

npm init -y

Create your src folder

Create a folder called src and add an empty index.js file. The code that webpack compiles goes in here including any Javascript modules and the main Tailwind file.

@SizableShrimp
SizableShrimp / README.md
Last active May 9, 2024 13:59
How to fix Java libraries not loading in Minecraft Forge 1.17+

How to fix Java libraries not loading in Minecraft Forge 1.17+

By default, Minecraft Forge does not load dependencies from the classpath unless they are explicitly declared as mods. These steps outline how to remedy this. This guide assumes that:

  1. You are on ForgeGradle 5 or higher.
  2. You are on Forge 1.17.1 (37.0.13) or higher.

Using Java libraries

To configure your Java libraries to be loaded by Forge, you should use the minecraftLibrary configuration provided by ForgeGradle. You now must make sure to declare your dependencies using minecraftLibrary configuration.