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
import random | |
# Random float in [0.0, 1.0) | |
a = random.random() | |
# Random float in [0, 100] | |
b = random.uniform( 0, 100 ) |
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
Listing queues ... | |
hipri 5 | |
lopri 0 | |
midpri 0 | |
...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
[package] | |
name = "example" | |
version = "0.1.0" | |
edition = "2021" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
anyhow = { version = "1.0", features = [ "backtrace" ] } | |
futures = "0.3" |
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 python | |
""" | |
This simple script fetches your IP as seen by web pages, and displays it. | |
Execute this script locally like that: | |
$ curl -s https://raw.github.com/gist/3389407/myip.py | python | |
""" | |
import urllib2 |
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 | |
## **Updates to this file are now at https://github.com/giovtorres/kvm-install-vm.** | |
## **This updated version has more options and less hardcoded variables.** | |
# Take one argument from the commandline: VM name | |
if ! [ $# -eq 1 ]; then | |
echo "Usage: $0 <node-name>" | |
exit 1 | |
fi |
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
struct CovariantExample<'a, T> { | |
a: &'a T | |
} | |
struct InvariantExample<'a, T> { | |
a: &'a mut T | |
} | |
fn covarient() { |
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
# Get rid of color codes | |
mutate { | |
gsub => ["message", "\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]", ""] | |
} |
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
image: docker.mydomain.com/build/kube-go-make | |
variables: | |
DOCKER_TAG: docker.mydomain.com/myapp/home:$CI_COMMIT_REF_SLUG | |
DOCKER_HOST: tcp://localhost:2375 | |
DOCKER_DRIVER: overlay | |
PROD_RSYNC_HOST: myprodserver.com | |
DOMAIN: mydomain.com | |
CHART_DIR: chart |
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
workflow "Demo workflow" { | |
on = "push" | |
resolves = ["SNS Notification"] | |
} | |
action "Build Image" { | |
uses = "actions/docker/cli@c08a5fc9e0286844156fefff2c141072048141f6" | |
runs = ["/bin/sh", "-c", "docker build -t $IMAGE_URI ."] | |
env = { | |
IMAGE_URI = "xxxxxxxx.dkr.ecr.ap-northeast-1.amazonaws.com/github-action-demo:latest" |
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/sh | |
if git rev-parse --verify HEAD >/dev/null 2>&1 | |
then | |
against=HEAD | |
else | |
# Initial commit: diff against an empty tree object | |
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 | |
fi | |