Skip to content

Instantly share code, notes, and snippets.

View dubiouscript's full-sized avatar

dubiouscript

  • ./
View GitHub Profile
@apalyukha
apalyukha / http_status.py
Created August 3, 2019 06:38
http status
STATUS_CODES = {
100: "100 Continue",
101: "101 Switching Protocols",
102: "102 Processing",
200: "200 OK",
201: "201 Created",
202: "202 Accepted",
203: "203 Non-authoritative Information",
204: "204 No Content",
@kfcobrien
kfcobrien / .BASH-PROMPT.png
Last active September 4, 2023 14:55
Clean informative bash prompt with git info
.BASH-PROMPT.png
@sinclairtarget
sinclairtarget / 1-cat-pdp7.s
Last active April 2, 2024 20:15
cat through the ages
" cat
lac 017777 i " Load accumulator (AC) with argument count
sad d4 " Skip next if we have more than 4 words of args
jmp nofiles " Otherwise, jump to nofiles
lac 017777 " Load AC with address of args
tad d1 " Increment AC by 1, past argument count
tad d4 " Increment AC by 4, now AC points to first real arg
dac name " Save arg pointer from AC into 'name'
@mbbx6spp
mbbx6spp / .00readme.org
Last active May 26, 2024 22:53
A caching and persistent Nix shell with direnv

Cached and Persistent Nix shell with direnv integration

Problem being solved

  • the default direnv Nix integration from projects loads a Nix shell every new terminal or every time shell.nix and/or default.nix changes. On larger projects with a lot of Nix shell dependencies, that can cause the terminal to take more than 6 seconds to load, which significantly degrades the developer experience (DX).
  • when a developer garbage collects in their Nix store, often the Nix shell dependencies are deleted also which causes a slow start the next time the project’s Nix shell is requested, also degrading developer experience (DX).

Solution outline

  • on first Nix shell load, the Nix shell is evaluated fully such that direnv dumps the environment from the spawn Nix shell process
query{
__type(name:"Repository") {
fields {
name
description
type {
kind
name
description
}
@mbbx6spp
mbbx6spp / USAGE.md
Last active April 15, 2019 11:21
Since people were asking about it from my tweet. This is just a simple wrapper I use.

nix-query usage

$ nix-query gifsicl
error: selector ‘gifsicl’ matches no derivations
?=1 | Error

$ nix-query gifsicle
nixos.gifsicle  gifsicle-1.88  Command-line tool for creating, editing, and getting information about GIF images and animations
?=0 | OK
@mertenvg
mertenvg / sorted-git-tag-list.sh
Created April 15, 2016 08:18
Show a list of git tags for a repository sorted by date
git tag --sort version:refname
@SomeCrazyGuy
SomeCrazyGuy / bash_pager.sh
Created April 1, 2016 01:25
A pager written entirely using bash 4 builtins, relies on no other system binaries.
#!/bin/bash --noprofile
# DO ALMOST ANYTHING PUBLIC LICENSE
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this code for any purpose as long as any "Credit"
# lines are not removed.
#Credit: /u/linuxversion
#<your Credit line here, if you want>
@lotabout
lotabout / send-to-download.js
Last active August 12, 2022 11:33
Greasemonkey script for send content to backend localhost.
// ==UserScript==
// @name Post test
// @namespace jinzhou
// @description Post Test
// @include *
// @version 1
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @grant GM_xmlhttpRequest
// @grant GM_addStyle
// ==/UserScript==
@Pysis868
Pysis868 / grub.cfg
Last active May 29, 2024 20:27
My own configuration file for GRUB2 to boot various live distributions of Linux-based operating systems, along with some system tools. I tried to include a lot of sample configuration entries, even if I don't currently use them, so it may help others. Exceedingly long blog post: http://tehfishyblog.logdown.com/chips/306146-a-homemade-ultimate-bo…
# Config for GNU GRand Unified Bootloader (GRUB) (2)
# /boot/grub2/grub.cfg
# or
# /boot/grub/grub.cfg
# Mostly only 'legacy' CSM/BIOS boot methods currently.
# Unable to boot loop entries with Secure Boot
# Notes:
# Description:
# This grub.cfg file was created by Lance http://www.pendrivelinux.com