Skip to content

Instantly share code, notes, and snippets.

@chrisdone
chrisdone / FieldTH.hs
Last active February 13, 2017 22:17
$(lens 'foo) -- handy one-off lens maker for record fields
{-# LANGUAGE TemplateHaskell #-}
-- | For when you have a record that doesn't have lenses derived for
-- it and you need a lens, just use @$(lens 'thefield)@ and away you go.
module Control.Lens.FieldTH where
import Language.Haskell.TH
lens :: Name -> Q Exp
lens name = do
[|\f r ->
fmap
$(lamE
@progandy
progandy / PKGBUILD
Last active March 6, 2024 17:51
Minimal MPRIS2 support for mpv
# PKGBUILD for lua52-lgi
# Maintainer: NONE
# lua-lgi Maintainer: speps <speps at aur dot archlinux dot org>
# lua-lgi Maintainer: Sébastien Luttringer
_pkgbase=lgi
pkgname=lua52-lgi
pkgver=0.9.1
pkgrel=1
pkgdesc='Lua 5.2 bindings for gnome/gobject using gobject-introspection library'
@diffficult
diffficult / chromeos-crosh-custom-setup.md
Last active October 4, 2024 08:41 — forked from bramford/chromeos-crosh-custom-setup.md
Customize your ChromeOS fonts - working April 2017

Customize Chromebook Chrosh Shell Environment

Requirement: Chromebook, Common Sense, Commandline Ablity, 1 hour of time

Dear developers with a spare Chromebook lets inject a little personalization into your Crosh shell with custom fonts, the solarized theme, and extra secure shell options.

Also, keep in mind that the terms Chrosh, Chrosh Window, and Secure Shell all refer to various versions and extentions built around the ChromeOS terminal. Settings that affect the ChromeOS terminal are global.

Custom Fonts

@ephemient
ephemient / nspawn-enter
Last active March 15, 2021 15:33
A substitute for "machinectl shell" when the systemd-machined inside the nspawn container is too old (e.g. CentOS 7)
#!/usr/bin/env python3
import argparse
import contextlib
import ctypes
import dbus
import errno
import fcntl
import io
import os
import pickle

KVM OSX Guest 10.11 (El Capitan) with Clover

  • Some notes about this approach:
    • An OSX Installer USB drive for Install OS X El Capitan is created
    • Clover is then installed on the USB drive
    • Clover Configurator is then run on the USB drive
    • The USB drive contents are copied to the VM host
    • VNC is used to connect to the guest UI
  • The qxl virtual video device is used (part of the standard kvm qemu install)
@max-mapper
max-mapper / readme.md
Last active January 31, 2025 03:52
Video stabilization using VidStab and FFMPEG (Mac OS X)

Video stabilization using VidStab and FFMPEG

Examples here use the default settings, see the VidStab readme on GitHub for more advanced instructions.

Here's an example video I made

Install ffmpeg with the vidstab plugin from homebrew

brew install ffmpeg --with-libvidstab
@stbuehler
stbuehler / abi-tag.patch
Last active December 14, 2015 16:37
clang abi-tag support.patch
Author: Stefan Bühler <[email protected]>
add gcc abi_tag support
- parse abi_tag attribute
- emit abi tags in name Itanium Mangling (but not for namespaces)
- for functions the abi tags from the return type need to be added
to the mangling of the function name, as long as they are not part of
the mangled function name otherwise (as tag on any involved namespace
or parameter type). Use nested "null" mangling of the signature to
# Check installed RAM, disable VM if 8Gb or more.
mem_inst=`/usr/sbin/sysctl -n hw.memsize`
if [ "$mem_inst" -ge "8589934592" ]; then
echo "8Gb+ Memory installed."
if [ "$action" == "unload" ]; then
sudo nvram boot-args="vm_compressor=2"
sudo pmset -a hibernatemode 0
echo "vm.compressor_mode set to 2"
@ttaubert
ttaubert / onion-gen.js
Created November 2, 2014 13:14
Generating custom .onion names with the WebCrypto API
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
/*
* thirty-two
* https://github.com/chrisumbel/thirty-two
*
@eddieantonio
eddieantonio / python.vim
Last active March 27, 2018 22:15
Vim Syntastic: automatically switch between python2 and python3 syntax checkers.
" Place this file in {VIMHOME}/after/ftplugin/python.vim
" Must have syntastic >= 3.5.0-29
" Use Python 3 when the shebang calls for it.
let b:syntastic_python_python_exec =
\ syntastic#util#parseShebang()['exe'] =~# '\m\<python3'
\ ? 'python3'
\ : 'python'