Skip to content

Instantly share code, notes, and snippets.

View aclements's full-sized avatar

Austin Clements aclements

View GitHub Profile
@aclements
aclements / scale.go
Created June 26, 2015 15:07
Scale down by 2x using x/image/draw
package main
import (
"flag"
"fmt"
"image"
"image/png"
"log"
"os"
@aclements
aclements / getg.py
Created January 9, 2017 19:07
$getg() function for gdb
import gdb
_Gdead = 6
class SliceValue:
"""Wrapper for slice values."""
def __init__(self, val):
self.val = val
@aclements
aclements / 17503-eliminate-rescan.md
Created October 18, 2016 20:04
Preview of proposal go/golang#17503

Proposal: Eliminate STW stack re-scanning

Author(s): Austin Clements, Rick Hudson

Last updated: 2016-10-18

Discussion at https://golang.org/issue/17503.

Abstract

@aclements
aclements / btg.py
Created May 24, 2017 22:06
Failed attempt at using GDB unwinders for Go core files
try:
from gdb.unwinder import Unwinder, register_unwinder
except ImportError:
Unwinder = None
if Unwinder is not None:
class FrameID(object):
def __init__(self, sp, pc):
self.sp = sp
self.pc = pc
@aclements
aclements / madv_free.go
Created October 29, 2018 15:30
Tool for experimenting with MADV_FREE
// You may want to first disable transparent huge pages:
//
// echo never | sudo tee /sys/kernel/mm/transparent_hugepage/enabled
package main
import (
"flag"
"fmt"
"io/ioutil"