This file contains hidden or 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
- name: Install Docker (including compose) | |
hosts: all | |
become: true | |
tasks: | |
- name: Update apt cache | |
apt: | |
update_cache: yes | |
- name: Install dependencies via apt |
This file contains hidden or 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
all: windows-amd64 macos-arm64 | |
windows-amd64: | |
mkdir -p dist | |
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CXX=x86_64-w64-mingw32-g++ CC=x86_64-w64-mingw32-gcc go build -o dist/main-windows-amd64.exe main.go | |
macos-arm64: | |
GOOS=darwin GOARCH=arm64 go build -o dist/main-macos-arm64 main.go | |
clean: |
This file contains hidden or 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
/** | |
* TODO: Write | |
* @param message | |
* @returns | |
*/ | |
export default function Confirmable(message: string) { | |
return function (target: Object, key: string | symbol, descriptor: PropertyDescriptor) { | |
const original = descriptor.value; | |
descriptor.value = function (...args: any[]) { | |
const allow = confirm(message); |
This file contains hidden or 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
@import url(https://fonts.googleapis.com/css?family=Open+Sans:300i,400,700); | |
body, table { | |
padding:50px; | |
font:14px/1.5 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif; | |
color:#555; | |
font-weight:300; | |
margin-left: auto; | |
margin-right: auto; | |
max-width: 1440px; |
This file contains hidden or 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
interface Virus { | |
public fun mutate() | |
public fun spread() { | |
println("Spreading the virus...") | |
} | |
} | |
class CoronaVirus: Virus { | |
override fun mutate() { | |
println("Mutating the corona virus...") |
This file contains hidden or 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
# Removes all .DS_Store files from the working directory | |
find . -name ".DS_Store" -delete |
This file contains hidden or 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 externalIP() (string, error) { | |
ifaces, err := net.Interfaces() | |
if err != nil { | |
return "", err | |
} | |
for _, iface := range ifaces { | |
if iface.Flags&net.FlagUp == 0 { | |
continue // interface down | |
} | |
if iface.Flags&net.FlagLoopback != 0 { |
This file contains hidden or 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
ifconfig | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}' |
This file contains hidden or 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
import os | |
if __name__ == '__main__': | |
for subdir, dirs, files in os.walk(os.getcwd()): | |
for file in files: | |
x = os.path.join(subdir, file) | |
if x.endswith("png"): | |
# Convert image | |
print "Converting {}".format(x) |
This file contains hidden or 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 file in *.html; do mv "$file" "${file/.html/.php}"; done |
NewerOlder