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
| --- | |
| - false | |
| - False | |
| - FALSE | |
| - n | |
| - N | |
| - no | |
| - No | |
| - NO | |
| - off |
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
| #!/usr/bin/env python3 | |
| import numpy as np | |
| import tensorflow as tf | |
| import scipy.misc | |
| import scipy.ndimage | |
| from tensorflow import sin, cos, sqrt, atan2 | |
| from math import pi | |
| top_circ = 265. |
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
| A quine is program that prints itself |
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
| #!/bin/bash | |
| [[ -d universe ]] || git clone git@github.com:mesosphere/universe.git | |
| for package_folder in universe/repo/packages/*/*; do | |
| pushd "${package_folder}" 1>/dev/null | |
| latest=$(ls -1 | sort -rn | head -n 1) | |
| if [[ "$(jq -r .framework $latest/package.json)" == "true" ]]; then | |
| jq -r .name "$latest/package.json" | |
| fi | |
| popd 1>/dev/null |
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
| $ uq troll-yaml.yaml | |
| { | |
| "country list": [ | |
| "US", | |
| "GB", | |
| false | |
| ], | |
| "end_date": 20130510, | |
| "favorite_prog_rock_band": true, | |
| "homedir_location": null, |
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
| # To see the differences in your native terminal: | |
| echo "Original img2xterm" | |
| wget -O - https://gist.github.com/solarkennedy/2544a9fe9ff4d76bedbc/raw/5cdba46e06c81815f80838a1c3b58f41cd659cc3/bender.img2xterm.ascii | |
| echo | |
| echo "New libpng img2xterm" | |
| wget -O - https://gist.github.com/solarkennedy/2544a9fe9ff4d76bedbc/raw/5cdba46e06c81815f80838a1c3b58f41cd659cc3/bender.new-img2xterm.ascii |
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
| #!/usr/bin/env python | |
| from captionstransformer.sbv import Reader | |
| from captionstransformer.srt import Writer | |
| r = open('captions.sbv') | |
| reader = Reader(r) | |
| w = open('captions.srt', 'w') | |
| writer = Writer(w) |
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
| #!/bin/bash | |
| set -u | |
| function analyze_aptget_line { | |
| # Inst dpkg [1.16.1.2ubuntu7.5] (1.16.1.2ubuntu7.6 Ubuntu:12.04/precise-security [amd64]) | |
| package=$2 | |
| current_version="${3//[\[\]]}" | |
| latest_version="${4//(}" | |
| escaped_version=$(echo $current_version | sed -e 's/[]\/$*.^|[]/\\&/g') | |
| echo "Package $package needs to be updated from $current_version to $latest_version:" |
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
| #!/usr/bin/env python2 | |
| import json,sys,urllib2,socket | |
| GREEN = '\033[92m' | |
| RED = '\033[91m' | |
| CLEAR = '\033[0m' | |
| from optparse import OptionParser | |
| parser = OptionParser() | |
| parser.add_option("-s", "--server", dest="server", |
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
| newfunction(:smartd_guess, :type => :rvalue, :doc => | |
| 'smartd_guess tries to guess which block devices are available for smart | |
| monitoring, and which should be ignored. | |
| It iterates through the $::blockdevices fact, and returns an ARRAY of HASHES | |
| compatible with the jhoblitt smartd module: | |
| https://github.com/jhoblitt/puppet-smartd#devices | |
| This function exists because smartd AUTOSCAN is too dumb, and manually | |
| specifying smartd configs on a per server basis is not web-scale. |