This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is based on the solution by Michel5 provided here https://community.home-assistant.io/t/solved-how-to-configure-avahi-daemon-on-docker-host/356422 | |
from zeroconf import ServiceBrowser, Zeroconf | |
class MyListener: | |
def remove_service(self, zeroconf, type, name): | |
print("Service %s removed" % (name,)) | |
def add_service(self, zeroconf, type, name): | |
info = zeroconf.get_service_info(type, name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
pub fn build(b: *std.Build) void { | |
const target = b.standardTargetOptions(.{}); | |
const optimize = b.standardOptimizeOption(.{}); | |
const exe = b.addExecutable(.{ | |
.name = "tmp", | |
.root_source_file = .{ .path = "src/main.zig" }, | |
.target = target, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat strace.txt.1035* | |
execve("./dial", ["./dial"], [/* 27 vars */]) = 0 | |
brk(NULL) = 0x1e67000 | |
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa9e3900000 | |
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 | |
fstat(3, {st_mode=S_IFREG|0644, st_size=40388, ...}) = 0 | |
mmap(NULL, 40388, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fa9e3904000 | |
close(3) = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "net" | |
func main() { | |
c, err := net.Dial("tcp", "google.com:80") | |
if err != nil { | |
panic(err) | |
} | |
c.Close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Boxstarter script | |
# To install Boxstarter and run this script: | |
# | |
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force | |
# Install-BoxstarterPackage -PackageName <RAW-GIST-URL> -DisableReboots | |
# | |
# Most of this was referenced from: | |
# - https://gist.github.com/jessfraz/7c319b046daa101a4aaef937a20ff41f | |
# - https://gist.github.com/NickCraver/7ebf9efbfd0c3eab72e9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! SwitchSourceHeader() | |
if (expand("%:e") == "cpp") | |
execute 'tag' join([expand("%:t:r"), "h"], ".") | |
else | |
execute 'tag' join([expand("%:t:r"), "cpp"], ".") | |
endif | |
endfunction | |
map <Leader>o :call SwitchSourceHeader()<CR> | |
map <Leader>i :vert belowright split<CR>:call SwitchSourceHeader()<CR> " Open alt file in a right pane |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am jamal on github. | |
* I am jamal (https://keybase.io/jamal) on keybase. | |
* I have a public key whose fingerprint is 344B 51C5 0799 A4E8 121E 1AF9 3E31 864F 52C0 075F | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WARNING: This will destroy ALL local changes that have not been dcommitted (even what has been committed to your local git repo) | |
git reset --hard git-svn/master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in {1..100} | |
do | |
convert -size 100x100 xc:rgba\(255,0,0,0.4\) -draw "fill white text 10,10 '$i'" $i.png | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r.db("test").table("queue").filter({"available": true}).limit(1).forEach(function (row) { | |
return r.db("test").table("queue").get(row("id")).update({"available": false}, {return_vals: true}) | |
}) |
NewerOlder