Skip to content

Instantly share code, notes, and snippets.

View dymk's full-sized avatar

Dylan Knutson dymk

  • Microsoft
  • PNW
View GitHub Profile
@dymk
dymk / avahi-suffix-remover.py
Created December 31, 2022 19:01
Watch for avahi state changes, and remove the `-2` suffix from the hostname
import dbus, avahi
from dbus.mainloop.glib import DBusGMainLoop
from gi.repository import GLib
import time
class Runner():
def __init__(self, avahi_server):
self.avahi_server = avahi_server
def on_state_change(self, state, error):
use tui::widgets::TextInputState;
tui::interactive_form_state!(struct Foo {
bar: TextInputState = "baz",
quux: TextInputState = "smaz",
whup: TextInputState
});
<div style='font-family: BIZ UDGothic; font-size: 48px;'>{{edit:Front}}</div>
<br>
<div style='font-family: BIZ UDGothic; font-size:24px;'>{{edit:Sentence}}</div>
<br>
<hr>
<br>
reading
<div id=reading>
TypeError: e is null @ map.js:4:34
Pu https://maps.googleapis.com/maps-api-v3/api/js/39/10/map.js:4
Qu https://maps.googleapis.com/maps-api-v3/api/js/39/10/map.js:3
@dymk
dymk / asdf.rb
Last active November 17, 2018 05:07
def foo(args, &block)
bar(**args, &block) # I want to call bar with the block passed to foo
end
def bar(arg1:, &block)
block.call(arg1)
end
foo(arg1: "aaa!") do |param|
print param # aaa!
@dymk
dymk / rw_tx_lock.cc
Created February 3, 2017 02:39
clang++-3.8 --std=c++14 rw_tx_lock.cc
#include <chrono>
#include <thread>
#include <mutex>
#include <atomic>
#include <utility>
#include <thread>
#include <memory>
#include <string>
#include <iostream>
@dymk
dymk / project_watcher.rb
Created January 23, 2017 23:12
Pretty generic project watcher for developing locally, and verifying compilation/tests on a remote server (made for UCSD CSE124)
# dependencies:
#gem install filewatcher
#gem install childprocess
#gem install net-sftp
# usage: ruby project_watcher.rb <user>@<server> <project or hw folder>
# e.g. ruby project_watcher.rb cse124XYZ@ieng6.ucsd.edu project1/
# you probably want to add the following to your .gitignore
# as well:
diff --git a/main.cpp b/main.cpp
index a1ac7bc..5bb18df 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1,21 +1,20 @@
#include "main.h"
-GLFWwindow* window;
-
void error_callback(int error, const char* description)
@dymk
dymk / Makefile
Last active September 28, 2016 00:23
CSE167 OSX Makefile
#Makefile flags for OSX devices
CFLAGS = -g -DGL_GLEXT_PROTOTYPES -DGL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED -DOSX
GLCCFLAGS := `pkg-config --cflags glfw3 glm glew`
GLLDFLAGS := `pkg-config --libs glfw3 glm glew`
INCFLAGS = -I/usr/X11/include -I./include/ $(GLCCFLAGS)
LDFLAGS = -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo \
-L"/System/Library/Frameworks/OpenGL.framework/Libraries" \
-lstdc++ -lGL $(GLLDFLAGS)
RM = /bin/rm -f
@dymk
dymk / keybase.md
Last active February 9, 2016 00:27

Keybase proof

I hereby claim:

  • I am dymk on github.
  • I am dymk (https://keybase.io/dymk) on keybase.
  • I have a public key ASAFTHCjQAvzt4vE7x0p1hggQkZ05gWFFkT0E4AEVmw2ugo

To claim this, I am signing this object: