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
///usr/bin/env go run "$0" "$@"; exit | |
package main | |
import "fmt" | |
func main() { | |
fmt.Println("My first Go script") | |
} |
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 ( | |
"fmt" | |
"net" | |
"os" | |
"sync/atomic" | |
"github.com/aeden/traceroute" | |
) |
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 ( | |
"crypto/x509" | |
"encoding/pem" | |
"fmt" | |
"io/ioutil" | |
"math" | |
"os" | |
"path/filepath" |
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 ( | |
"context" | |
"net/http" | |
"os" | |
"syscall" | |
"github.com/go-kit/kit/log" | |
"github.com/go-kit/kit/log/level" |
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
------------------------------------------------------------------------------- | |
-- ShiftIt / Spectacle style window manager | |
------------------------------------------------------------------------------- | |
-- Source/inspiration: https://github.com/fikovnik/ShiftIt/wiki/The-Hammerspoon-Alternative | |
-- Docs hotkey module: https://www.hammerspoon.org/docs/hs.hotkey.html | |
-- Docs keycodes: https://www.hammerspoon.org/docs/hs.keycodes.html#map | |
hs.window.animationDuration = 0.1 | |
units = { |
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
tell application "System Events" | |
set procs to processes | |
set windowName to {} | |
repeat with proc in procs | |
# Ignore applications that are hidden altogether (cmd+H or via command from the application's menu) | |
# Applications open on different desktops are ignored alltogether | |
if (visible of proc) then | |
if exists (window 1 of proc) then | |
repeat with w in windows of proc | |
# Ignore application windows miniaturezed to the dock |
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
func checkFileType(sender: NSDraggingInfo) -> Bool { | |
let pasteboard = sender.draggingPasteboard() | |
// Iterate over accepted types of currently selected Workflow in its order of preference | |
// Return as soon as a present type of the dropped item matches an accepted type of the Workflow | |
for acceptedType in Workflows.activeAccepts { | |
if String(acceptedType) == "filename" { | |
if pasteboard.types?.contains("public.file-url") == true { | |
// File URLs from Finder (files, folders, drives) |
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 "fmt" | |
type person struct { | |
firstName string | |
lastName *string | |
addressAsValue address | |
addressAsPointer *address |
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
#!/bin/bash | |
# Install the inotify tools in Dockerfile: | |
# RUN apt-get update && apt-get install -y inotify-tools | |
# Then establish the watch in the Docker entrypoint.sh: | |
# ./inotify_watcher.sh & | |
inotifywait --monitor "/etc/envoy/k8s/" --event create --event modify --event moved_to | | |
while read path action file; do |
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 ( | |
"fmt" | |
"os" | |
log "github.com/sirupsen/logrus" | |
) | |
func main() { |
NewerOlder