Skip to content

Instantly share code, notes, and snippets.

@danimad
danimad / ANSI.md
Created March 19, 2023 10:39 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@danimad
danimad / README
Created January 6, 2023 13:20 — forked from jmatsushita/README
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
# Inspired by https://github.com/malob/nixpkgs I highly recommend looking at malob's repo for a more thorough configuration
#
# Some people are coming directly to this Gist from search results and not the original post[1]. If that sounds like you, you should also know there is a video[2] that accompanies this.
#
# [1] https://discourse.nixos.org/t/simple-workable-config-for-m1-macbook-pro-monterey-12-0-1-with-nix-flakes-nix-darwin-and-home-manager/16834
# [2] https://www.youtube.com/watch?v=KJgN0lnA5mk
#
@danimad
danimad / make-keys.bat
Created March 16, 2021 20:11 — forked from codingoutloud/make-keys.bat
Handy OpenSSL command-line combinations I've used - they might've been hard to find or come up with, so capturing them here.
@echo off
if _%1_==__ goto USAGE
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem -subj "/CN=My Cert Name"
openssl pkcs12 -export -out mycert.pfx -inkey mycert.pem -in mycert.pem -passout pass:%1
openssl x509 -inform pem -in mycert.pem -outform der -out mycert.cer
openssl pkcs12 -in mycert.pfx -nodes -passin pass:%1 | openssl x509 -noout -fingerprint
openssl x509 -in mycert.pem -noout -fingerprint
# Written with Azure PowerShell module v6.1.0 available from https://github.com/Azure/azure-powershell/releases/tag/v6.1.0-May2018
# Recently tested fully with a later version of the Azure PowerShell module - Install-Module AzureRM -RequiredVersion 6.1.0
######################
############## Step 0: Change Variables, and logon
######################
# Define Azure Automation Assets
$AutomationAppIDName = 'AutomationAppId' # Feel free to change to suit you
$AutomationTenantIDName = 'AutomationTenantId' # Feel free to change to suit you
@danimad
danimad / gist:ac32d8d6a2f124df6003d0becc261e66
Created July 4, 2017 17:25 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@danimad
danimad / europe.R
Created April 23, 2017 19:52 — forked from halhen/europe.R
# data from http://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/population-distribution-demography/geostat
# Originally seen at http://spatial.ly/2014/08/population-lines/
library(tidyverse)
read_csv('../data/geostat-2011/GEOSTAT_grid_POP_1K_2011_V2_0_1.csv') %>%
rbind(read_csv('../data/geostat-2011/JRC-GHSL_AIT-grid-POP_1K_2011.csv') %>%
mutate(TOT_P_CON_DT='')) %>%
mutate(lat = as.numeric(gsub('.*N([0-9]+)[EW].*', '\\1', GRD_ID))/100,
lng = as.numeric(gsub('.*[EW]([0-9]+)', '\\1', GRD_ID)) * ifelse(gsub('.*([EW]).*', '\\1', GRD_ID) == 'W', -1, 1) / 100) %>%

Keybase proof

I hereby claim:

  • I am danimad on github.
  • I am danielberecz (https://keybase.io/danielberecz) on keybase.
  • I have a public key whose fingerprint is 855E 641A D717 FC05 059B B2CB 9D4B 1BF9 5C73 E947

To claim this, I am signing this object: