Skip to content

Instantly share code, notes, and snippets.

View chaoky's full-sized avatar
🦩
in a nix rebound phase

Chaoky chaoky

🦩
in a nix rebound phase
View GitHub Profile
@abcdw
abcdw / nix vs guix.org
Last active February 17, 2024 14:21
nix vs guix.org

Nix vs Guix

These are notes to the stream: https://youtu.be/S9V-pcTrdL8

Some notes

  • We are not aware of a lot of GNU software available to us.
  • Seems that Guix more hacker-friendly/explorable.

General comparsion

DescriptionNixGuixComment
@yorickvP
yorickvP / wl-clipboard.el
Created March 14, 2019 11:02
teach emacs to use wl-copy
(setq wl-copy-process nil)
(defun wl-copy (text)
(setq wl-copy-process (make-process :name "wl-copy"
:buffer nil
:command '("wl-copy" "-f" "-n")
:connection-type 'pipe))
(process-send-string wl-copy-process text)
(process-send-eof wl-copy-process))
(defun wl-paste ()
(if (and wl-copy-process (process-live-p wl-copy-process))
@sarthology
sarthology / regexCheatsheet.js
Created January 10, 2019 07:54
A regex cheatsheet 👩🏻‍💻 (by Catherine)
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
@Aaron-Macneill
Aaron-Macneill / autohide.sh
Created March 5, 2018 20:35
A script to autohide polybar using xdo and xwininfo
#!/bin/sh
# Get Polybar ID
id=$(xdo id -N "Polybar")
# If Polybar is viewable hide it. Otherwise, show it.
if xwininfo -id $id | grep -q "IsViewable"; then
xdo hide -N "Polybar"
else
xdo show -N "Polybar"
@andrevdm
andrevdm / Scotty_websockets.hs
Last active March 6, 2024 01:51
Using websockets with scotty haskell
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Protolude
import qualified Web.Scotty as Sc
import qualified Data.Text as Txt
import qualified Network.Wai.Middleware.Gzip as Sc
@fridtjof
fridtjof / powershell_wrapper.sh
Last active January 14, 2024 22:04
This is a wrapper for launching powershell scripts using shebang on WSL. Put the name of your user's directory into the second line, save this file into /usr/bin and make it executable.
#!/bin/bash
YOUR_WINDOWS_USERDIRECTORY_NAME_HERE=""
WIN_TEMP_PATH="/mnt/c/Users/$YOUR_WINDOWS_USERDIRECTORY_NAME_HERE/AppData/Local/Temp"
CURRENT_DIR=`pwd`
if [ $# -eq 0 ]
then
echo "No arguments supplied"
exit 1
@PragTob
PragTob / benchmark_result
Created November 1, 2016 08:24
TCO vs. non TCO with 10_000_000 elements
tobi@happy ~/github/elixir_playground $ mix run bench/my_map_bench.exs
Erlang/OTP 19 [erts-8.1] [source-4cc2ce3] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
Elixir 1.3.4
Benchmark suite executing with the following configuration:
warmup: 10.0s
time: 30.0s
parallel: 1
Estimated total run time: 360.0s
Benchmarking exactly_like_my_map...
@todgru
todgru / starttmux.sh
Last active April 27, 2024 18:17
Start up tmux with custom windows, panes and applications running
#!/bin/sh
#
# Setup a work space called `work` with two windows
# first window has 3 panes.
# The first pane set at 65%, split horizontally, set to api root and running vim
# pane 2 is split at 25% and running redis-server
# pane 3 is set to api root and bash prompt.
# note: `api` aliased to `cd ~/path/to/work`
#
session="work"