Skip to content

Instantly share code, notes, and snippets.

@shazow
shazow / ThinkpadX1Carbon6thgen.md
Last active September 15, 2022 15:38
Thinkpad X1 Carbon 6th gen configs

Configs

/etc/conf.d/*: ...

Modules

/etc/modprobe.d/i915.conf:

options i915 enable_guc_loading=1 enable_guc_submission=1 enable_fbc=1 enable_psr=1
@shazow
shazow / .config
Created March 2, 2018 17:53
shazowic-corvus kernel build: thinkpad x1 carbon 6th gen (not perfect yet)
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 4.15.7-gentoo-r1 Kernel Configuration
#
#
# Gentoo Linux
#
CONFIG_GENTOO_LINUX=y
CONFIG_GENTOO_LINUX_UDEV=y
@shazow
shazow / gc_debug.py
Created April 4, 2017 17:22
Debug Python memory leaks
collections.Counter(str(type(obj)) for obj in gc.get_objects())
@shazow
shazow / SimpleGeo.cs
Created January 7, 2017 18:31 — forked from phosphoer/SimpleGeo.cs
Simple Geometry Painter for Unity
// The MIT License (MIT)
// Copyright (c) 2016 David Evans @phosphoer
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
@shazow
shazow / multierror.go
Last active September 18, 2016 17:26
Yet another Go MultiError
package main
import (
"fmt"
"strings"
)
// MultiError implements the Error interface, can be checked as nil just like normal errors.
func MultiError() multiError {
var err multiError = nil
@shazow
shazow / watch-sshchat.md
Last active August 18, 2016 19:30
out of band ssh-chat ding watcher lol

First make a fifo

$ export fifopath=$PWD/chat.fifo
$ mkfifo "$fifopath"

Then start reading from the fifo and looking for the ^G ding escape code.

@shazow
shazow / .vimrc
Last active August 7, 2016 21:47
Makefile for my SCSS stuff
" Find the nearest Makefile and run it
function! MakeUp()
let makefile = findfile("Makefile", ".;")
if makefile != ""
silent exe "NeomakeSh make -C " . fnamemodify(makefile, ':p:h')
endif
endfunction
autocmd BufWritePost *.scss call MakeUp()
@shazow
shazow / ptrproxy.go
Created May 9, 2016 17:57
Safe pointer proxy for lending pointers across runtimes
package main
import "sync"
type ptrId uint
type ptrProxy struct {
sync.Mutex
count uint
lookup map[ptrId]interface{}
@shazow
shazow / Makefile
Last active January 25, 2016 01:52
My bourbon base override
all: scss
CSS_OUT = ../static/css/screen.css
SCSS_LIBS = ./lib/
$(CSS_OUT): **.scss $(SCSS_LIBS)
sassc --style nested $(addprefix -I ,$(SCSS_LIBS)) screen.scss $(CSS_OUT)
scss: $(CSS_OUT)
@shazow
shazow / a.go
Last active October 13, 2015 01:32
Constructors in Go
package tmp
import "net"
type ServerA struct {
Clients map[string]net.Conn
}
func (srv *ServerA) Accept(conn net.Conn) error {
key := conn.RemoteAddr().String()