Skip to content

Instantly share code, notes, and snippets.

View adriancmiranda's full-sized avatar
🌱
Today, what did you do for you tomorrow?

Adrian Miranda adriancmiranda

🌱
Today, what did you do for you tomorrow?
View GitHub Profile
@adriancmiranda
adriancmiranda / vsls
Created July 20, 2021 22:55 — forked from b333z/vsls
vccode live share nixos
#!/usr/bin/env bash
# TODO: Look at nixpkgs/pkgs/build-support/setup-hooks/auto-patchelf.sh
# https://ms-vsliveshare.gallery.vsassets.io/_apis/public/gallery/publisher/MS-vsliveshare/extension/vsliveshare/0.3.423/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage
set -eu
TOOLS="patchelf xsel"
DEPS="utillinux.out openssl.out icu zlib curl.out lttng-ust libsecret libkrb5"
@adriancmiranda
adriancmiranda / tabc.sh
Created July 18, 2021 18:27 — forked from jpentland/tabc.sh
Add or remove windows from suckless' tabbed
#!/bin/sh
# Usage:
# tabc.sh <tabbed-id> <command>
# Commands:
# add <window-id> - Add window to tabbed
# remove <window-id> - Remove window from tabbed
# list - List all clients of tabbed
#
@adriancmiranda
adriancmiranda / README.md
Created July 17, 2021 21:21
NixOS + Ryzen
[Issue]: https://github.com/NixOS/nixpkgs/issues/64443
@adriancmiranda
adriancmiranda / tsconfig.json
Created July 3, 2021 18:36 — forked from cezaraugusto/tsconfig.json
JSON schema for the TypeScript compiler's configuration file
{
"title": "JSON schema for the TypeScript compiler's configuration file",
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
"filesDefinition": {
"properties": {
"files": {
"description": "If no 'files' or 'include' property is present in a tsconfig.json, the compiler defaults to including all files in the containing directory and subdirectories except those specified by 'exclude'. When a 'files' property is specified, only those files and those specified by 'include' are included.",
"type": "array",
@adriancmiranda
adriancmiranda / prepare-commit-msg
Created July 3, 2021 11:36 — forked from emirhg/prepare-commit-msg
prepare-commit-msg
#!/bin/zsh
# Author: "Emir Herrera" <[email protected]>
# Donations: http://paypal.me/emirhg
#
# A GIT Hook to Pregenerate a Commit Message with an elapsed working time taken from the time tracker ActivityWatch. A `ref #123 @1.h` message like is generated taking the activity number from the branch name and te time from ActivityWatch Web API. Requires JQ in order to add all the events recorded by ActivityWatch
#
# Usage:
#
# copy this file under "${GIT_WORKING_TREE}/.git/hooks/prepare-commit-msg and set execution permitions
#
@adriancmiranda
adriancmiranda / TrueColour.md
Created July 2, 2021 01:50 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)

I was hacking my custom middleware into the webpack-dev-server like this:

start.js

// start.js
// use custom serverSideRender middleware with webpack-dev-server
const serverSideRenderMiddleware = require('./ssr-middleware')

// Copy the defaultFeatures logic from webpack-dev-server. We need to hack the

Nix syntax basics

Intro

Comments

@adriancmiranda
adriancmiranda / NixSetup.md
Created December 31, 2020 02:04 — forked from rehno-lindeque/NixSetup.md
NixOS Setup (Virtualized + Haskell + Gnome3 + XMonad)

Setup NixOS (Virtualized + Haskell + Gnome3 + XMonad)

Before you get started

This is pretty out of date now... you may want to look elsewhere

Newer guides than mine (mine is a bit dated and has a lot of rough edges):

Have you looked at these?

@adriancmiranda
adriancmiranda / free-memory.rb
Created May 24, 2020 03:49 — forked from vigo/free-memory.rb
"free" command for osx. Shows available memory
#!/usr/bin/env ruby
# encoding: utf-8
# By Uğur Özyılmazel, @vigobronx | @ugurozyilmazel
# http://vigodome.com | http://ugur.ozyilmazel.com | http://github.com/vigo
def get_paged_memory_usage(match_string, paging=4096)
mvar = 3
if match_string.split(/[^\w]/).length > 1
mvar = 4