Skip to content

Instantly share code, notes, and snippets.

View anxiousmodernman's full-sized avatar
🎺
ready for a ska revival

Coleman McFarland anxiousmodernman

🎺
ready for a ska revival
View GitHub Profile
@anxiousmodernman
anxiousmodernman / adapter.go
Created July 30, 2017 19:36
Adapting grpc streaming endpoint to io.Reader
// PutStreamAdapter turns our GMData_PutStreamServer into an io.Reader
type PutStreamAdapter struct {
stream GMData_PutStreamServer
buf *bytes.Buffer
eof bool
}
// NewPutStreamAdapter initializes our io.Reader wrapper type for the PutStream endpoint.
func NewPutStreamAdapter(s GMData_PutStreamServer) *PutStreamAdapter {
@anxiousmodernman
anxiousmodernman / backtrace.txt
Last active August 19, 2017 21:05
backtrace
Using device: GTX 1060 (type: DiscreteGpu)
thread 'main' panicked at 'unexpected error: DeviceLost', /home/coleman/.cargo/registry/src/github.com-1ecc6299db9ec823/vulkano-0.6.0/src/lib.rs:161
stack backtrace:
0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::_print
at /checkout/src/libstd/sys_common/backtrace.rs:71
2: std::panicking::default_hook::{{closure}}
at /checkout/src/libstd/sys_common/backtrace.rs:60
{% if ports is undefined %} {% set ports=[] %} {% endif %}
{% if env_vars is undefined %} {% set env_vars=[] %} {% endif %}
{% if volume_mounts is undefined %} {% set volume_mounts=[] %} {% endif %}
{% if hostname is undefined %} {% set host_arg='--net=host' %} {% else %} {% set host_arg='--hostname=%s' % hostname %} {% endif %}
{% if image_cmd is undefined %} {% set image_cmd='' %} {% endif %}
[Unit]
Description={{ description }}
Requires=network-online.target docker.service
@anxiousmodernman
anxiousmodernman / config.toml
Last active October 21, 2017 22:15
Host provisioning tool config
# Outline of a TOML-based DSL for configuring hosts. For now, we assume we execute these "on the box".
# Imports are processed first, and given the correct precedence as if they were passed on the command
# line. If an import uses a resolver
imports = [
"/path/to/local/something.toml",
"bucket1://some/remote.toml"
]
# Bucket is a resolver type. Configure a bucket called bucket1.
@anxiousmodernman
anxiousmodernman / enum.c
Created November 5, 2017 22:38
bindgen makes a u8 alias for this
/* original code:
https://github.com/jamesmunns/nrf52dk-sys/blob/master/nRF5-sdk/components/device/nrf52.h#L74-L126
*/
typedef enum {
/* ------------------- Cortex-M4 Processor Exceptions Numbers ------------------- */
Reset_IRQn = -15, /*!< 1 Reset Vector, invoked on Power up and warm reset */
NonMaskableInt_IRQn = -14, /*!< 2 Non maskable Interrupt, cannot be stopped or preempted */
@anxiousmodernman
anxiousmodernman / helper.go
Created January 9, 2018 00:14
helper function for grpc golang tests
func grpcListenerClientCleanup() (*grpc.Server, server.ProxyClient, func()) {
    // Proxy, our concrent implementation
    dir, _ := ioutil.TempDir("", "co-chair-test")
    dbPath := filepath.Join(dir, "co-chair-test.db")
    px, _ := NewProxy(dbPath)
    // grpc server setup
    gs := grpc.NewServer()
@anxiousmodernman
anxiousmodernman / attempt.md
Last active January 16, 2018 04:14
Trying to build steed

I just ran into this issue trying to build in Arch using the lld strategy (e.g. not Docker/cross). I'm trying to compile steed itself, not a dependent crate.

Note: The redox issue linked seems to be closed. So I'm assuming we still need to use naive_ralloc.

I edited Xargo.toml per this discussion, but it didn't quite work.

@anxiousmodernman
anxiousmodernman / log.txt
Created January 21, 2018 19:21
alacritty i3 log
01/21/18 19:18:35 - i3 4.14.1 (2017-09-24) starting01/21/18 19:18:35 - Parsing configfile /home/coleman/.config/i3/config01/21/18 19:18:35 - deciding for version 4 due to this line: # i3 config file (v4)01/21/18 19:18:35 - ERROR: You did not specify required configuration option "font"01/21/18 19:18:35 - [libi3] ../i3-4.14.1/../i3-4.14.1/libi3/font.c Using X font fixed01/21/18 19:18:35 - Used number 1 for workspace with name 101/21/18 19:18:35 - This is not an in-place restart, copying root window contents to a pixmap01/21/18 19:18:35 - Starting bar process: i3bar --bar_id=bar-0 --socket="/run/user/1000/i3/ipc-socket.613"01/21/18 19:18:35 - executing: i3bar --bar_id=bar-0 --socket="/run/user/1000/i3/ipc-socket.613"01/21/18 19:18:35 - IPC: looking for config for bar ID "bar-0"01/21/18 19:18:35 - workspace visible? fs = 0x55d0c605ebc0, ws = 0x55d0c605ebc001/21/18 19:18:35 - WM_CLASS changed to i3bar (instance), i3bar (class)01/21/18 19:18:35 - WM_NAME changed to "i3bar for output LVDS-1"01/21/18 19:18:35 - Usin
@anxiousmodernman
anxiousmodernman / notes.md
Last active February 15, 2018 01:20
Notes on a dataframe environment

What's a dataframe?

A dataframe is a 2 dimensional data structure, a "list of lists", where the items in the list can be of any type. Dataframes are similar to a spreadsheet or a SQL table. The word "dataframe" was popularized by pandas, the widely-used Python library, and R, a programming language devoted to data analysis.

@anxiousmodernman
anxiousmodernman / opacity.tcl
Last active April 13, 2018 19:43
Tcl update alacritty config
#!/usr/bin/env tclsh
set timestamp [clock format [clock seconds] -format {%Y%m%d%H%M%S}]
set newOpacity [lindex $argv 0]
puts "got arg: $newOpacity" # check args
if {[string is integer $newOpacity] == 0} {
puts "You must pass an integer value for opacity"
exit 1
}
set filename "~/.config/alacritty/alacritty.yml"
set temp $filename.new.$timestamp