Skip to content

Instantly share code, notes, and snippets.

@stephancasas
stephancasas / NSApplication+NSResponderDebug.swift
Created March 18, 2024 20:35
An extension on NSApplication providing a computed property that describes the current responder chain.
//
// NSApplication+NSResponderDebug.swift
//
// Created by Stephan Casas on 3/18/24.
//
import Cocoa;
extension NSApplication {
@renatus-cartesius
renatus-cartesius / .dsl
Created April 1, 2022 21:44
untitled: a trio from https://penrose.ink
type Set
@cxyxlxdm
cxyxlxdm / GridSpacingItemDecoration.md
Last active April 19, 2024 08:43
Add column spacing in RecyclerView with GridLayoutManager

Android Recyclerview GridLayoutManager column spacing Here is the question, the first answer does not work well in my project,and it makes the spacing bigger between item and item. the second answer is quite perfect.But if RecyclerView has headers,it does not work well. Then I fixed it.

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**

What I want from a run-Python-in-WASM solution

I want to be able to use WebAssembly as a sandbox to safely run Python code from untrusted sources, within my existing Python applications.

I'd like to be able to:

  • Pass in an untrusted string of Python code and have that evaluated
  • Maybe also pass in initial variables to be used in the code - though hard-coding them would work OK too
  • Have the code run in a sandboxed environment, with a timeout and memory limit
  • The sandbox disallows network access and disk access - it can only access the variables passed in
@rumansaleem
rumansaleem / clean-up-arch-linux.md
Created May 28, 2019 08:51
Instructions to clean up Arch Linux (Manjaro)

Contents

  • Clean pkg cache
  • Remove unused packages (orphans)
  • Clean cache in /home
  • remove old config files
  • Find and Remove
    • duplicates
    • empty files
    • empty directories
  • broken symlinks
@obenjiro
obenjiro / nodejs-fatal-flow.md
Last active April 19, 2024 08:39
Фатальный недостаток Node.js
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 19, 2024 08:33
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active April 19, 2024 08:32
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@schneefisch
schneefisch / restart_pods.md
Last active April 19, 2024 08:32
How to restart all pods in a statefulset or deployment

Various ways to restart pods

Restart deployment

The most gracefull way is to trigger a restart for the deployment. In this case, a pod will only be terminated once the new pod is ready. It will slowly replace all pods one after the other.

kubectl rollout restart deployment <deployment-name>

Restart pods in a statefulset