Skip to content

Instantly share code, notes, and snippets.

@Azeirah
Azeirah / setup-gitlab-for-magit-in-doom-emacs.md
Last active May 22, 2024 15:35
Setting up magit forge for gitlab in Doom Emacs

Magit forge for Gitlab in Doom Emacs

This guide assumes you're working on a Unix-like environment. I'm using Linux Mint (Ubuntu). It should work on Macs, and might on Windows.

These are the four steps you can use as a checklist, see the headings below for the details on each step.

  • Enable forge support
  • Create a Gitlab API key
  • Add your gitlab credentials to ~/.authinfo.gpg
  • Set-up forge in emacs
@haxoza
haxoza / docker-compose.yml
Created July 24, 2019 11:11
Local S3 with Minio and created bucket on startup
version: '3'
services:
minio:
image: minio/minio:RELEASE.2019-07-17T22-54-12Z
volumes:
- data:/data
ports:
- "9000:9000"
networks:
% ==== Document Class & Packages =====
\documentclass[12pt,hidelinks]{article}
\usepackage[explicit]{titlesec}
\usepackage{titletoc}
\usepackage{tocloft}
\usepackage{charter}
\usepackage[many]{tcolorbox}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{xcolor}
@koshatul
koshatul / README.md
Last active July 10, 2024 09:25
use Apple Keychain to store GPG Passphrases

gpg-agent setup

Need to setup gpg-agent first, on OSX I use keychain (it also does ssh-agent)

$ brew info keychain
keychain: stable 2.8.5
User-friendly front-end to ssh-agent(1)
https://www.funtoo.org/Keychain
/usr/local/Cellar/keychain/2.8.5 (7 files, 108.5KB) *
@chenyong
chenyong / check.cljs
Created June 3, 2019 03:28
Comparing Clojure spec and TypeScript with multiple structs
(def data {
:mock-all? false
:mocks [
{:path "api/test/json", :type :json :status 200 :data {"code" 200, "message" "This is a test json message in EDN"}}
{:path "api/test/file", :type :file :status 200 :file "user-info.json"}
{:path "api/test/text", :type :text :status 200 :text "user-info.json"}
]
:sites {
"api" {:target :apis}
"web" {:target :proxy, :path "/web", :host "http://localhost:8200"}
function tmc() {
before=$(df -hl / |awk '{print $3}' |tail -n1)
count=0
for snapshot in $(tmutil listlocalsnapshots /|awk -F. '{print $4}');do
let 'count++'
echo "delete snapshot $snapshot"
tmutil deletelocalsnapshots $snapshot;
done
after=$(df -hl / |awk '{print $3}' |tail -n1)
if [[ $count -ne 0 ]]; then
@gregdel
gregdel / gogs-migrate.sh
Last active April 26, 2022 01:01
Gitlab to gogs migration
#!/bin/sh
set -e
_usage() {
echo "Usage: $0 [--user|org] USER_OR_ORG_NAME GOGS_REPO_NAME GITLAB_HTTPS_URL"
exit 0
}
MODE=$1
@hjertnes
hjertnes / doom.txt
Created April 6, 2018 08:28
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
(ns switch
(:require [clojure.pprint :as pprint]))
(defn project-clj-map [filename]
(->> (slurp filename)
(read-string)
(drop 1)
(partition 2)
(map vec)
(into {})))
@mjdietzx
mjdietzx / download_image.py
Last active March 21, 2024 11:12
Download image from url and save as file
import io
from PIL import Image # https://pillow.readthedocs.io/en/4.3.x/
import requests # http://docs.python-requests.org/en/master/
# example image url: https://m.media-amazon.com/images/S/aplus-media/vc/6a9569ab-cb8e-46d9-8aea-a7022e58c74a.jpg
def download_image(url, image_file_path):
r = requests.get(url, timeout=4.0)
if r.status_code != requests.codes.ok: