Skip to content

Instantly share code, notes, and snippets.

@cvan
cvan / set-up-chromium-keys.md
Last active November 11, 2025 01:33
Launch Chromium with API Keys on Mac OS X and Windows

Last Updated: March 2023

IMPORTANT: Ignore the out-of-date steps below for getting Chromium keys.

Instead, read this up-to-date guide (Jan 2023) written by @LearningToPi.

P.S. Thank you to every contributor below who provided tips over the years on what should be a straightforward process: setting up Chromium for local development.

Long live the web!

@edolstra
edolstra / nix-ui.md
Last active August 16, 2025 00:03
Nix UI

General notes

  • nix-channel and ~/.nix-defexpr are gone. We'll use $NIX_PATH (or user environment specific overrides configured via nix set-path) to look up packages. Since $NIX_PATH supports URLs nowadays, this removes the need for channels: you can just set $NIX_PATH to e.g. https://nixos.org/channels/nixos-15.09/nixexprs.tar.xz and stay up to date automatically.

  • By default, packages are selected by attribute name, rather than the name attribute. Thus nix install hello is basically equivalent to nix-env -iA hello. The attribute name is recorded in the user environment manifest and used in upgrades. Thus (at least by default) hello won't be upgraded to helloVariant.

    @vcunat suggested making this an arbitrary Nix expression rather than an attrpath, e.g. firefox.override { enableFoo = true; }. However, such an expression would not have a key in the user environment, unlike an attrpath. Better to require an explicit flag for this.

TBD: How to deal with search path clashes.

{ lib, config, pkgs, ... }:
{
imports = [ ./iscsi-boot.nix ];
fileSystems = {
"/" = { device = "UUID=132e7c5b-b4a9-4154-8105-4479e17f4f5b"; fsType = "ext4"; };
"/boot/" = { device = "UUID=fdac080d-d111-455c-a890-bc3e5e08c2d5"; fsType = "ext4"; };
};
boot = {
loader = {

Problems & Solutions for Interaction Between C and Go

At Vimeo, on the transcoding team, we work a lot with Go, and a lot with C, for various tasks such as media ingest. This means we use CGO quite extensively, and consequently, have run into bits that are perhaps not very well documented, if at all. Below is my effort to document some of the problems we've run into, and how we fixed or worked around them.

Many of these are obviously wrong in retrospect, but hindsight is 20/20, and these problems do exist in many codebases currently.

Some are definitely ugly, and I much welcome better solutions! Tweet me at @daemon404 if you have any, or have your own CGO story/tips, please! I'd love to learn of them.

Table of Contents

@acdvorak
acdvorak / tmux-all-panes.sh
Last active August 6, 2021 17:09 — forked from yubink/inall.sh
tmux: run a command in all panes
#!/bin/bash
# Runs the specified command (provided by the first argument) in all tmux panes
# in every window. If an application is currently running in a given pane
# (e.g., vim), it is suspended and then resumed so the command can be run.
all-panes()
{
all-panes-bg_ "$1" &
}
@sailor
sailor / Vagrantfile
Created March 25, 2015 13:09
Vagrantfile for Rails development environment
VAGRANTFILE_API_VERSION = '2'
$install = <<SCRIPT
curl -L https://github.com/docker/fig/releases/download/1.0.1/fig-`uname -s`-`uname -m` > /usr/local/bin/fig
chmod +x /usr/local/bin/fig
SCRIPT
$build = <<SCRIPT
cd /vagrant
fig build
@stephanos
stephanos / install-app-engine-sdk
Last active January 15, 2017 08:33
Download current Go App Engine SDK
#!/bin/bash
VERSION_URL="https://appengine.google.com/api/updatecheck"
VERSION=$(echo $(curl ${VERSION_URL}) | sed -E 's/release: \"(.+)\"(.*)/\1/g')
ARCH="386"
if [[ `uname -a` == *x86_64* ]]
then
ARCH="amd64"
fi
@robinsmidsrod
robinsmidsrod / dhcpd.conf
Last active October 29, 2025 23:05
Booting an Apple Mac into iPXE using simulated Apple Boot Server on ISC DHCPD
next-server 10.0.3.2;
if ( substring(option vendor-class-identifier, 0, 9) = "AAPLBSDPC"
and substring(option vendor-class-identifier, 10, 4) = "i386" ) {
# This needs to be there to tell the client we're an Apple boot server
option vendor-class-identifier "AAPLBSDPC";
# Normally the client asks for a list, we respond, they tell us what we want,
# then we send a select back with the information of that image.
# This skips all that and forces the select down to the client.
option vendor-encapsulated-options 01:01:02;
# Use ipxe.efi for native drivers, or snponly.efi for underlying UNDI
// EDIT: SOLVED!
// The arguments are supposed to be
// [--no-pager log --all --source --abbrev-commit --grep=Story-Id: 12345]
// not
// [--no-pager log --all --source --abbrev-commit --grep='Story-Id: 12345']
// because then it doesn't find the commits and then output is empty.
// The problem is that my function is returning empty stdout buffer
// even though the output is not empty when I run git from CLI.
//
@varver
varver / cookie_jar_golang.go
Last active June 7, 2022 13:04
Login to a website with this golang code using persistent cookies or cookie jar .