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
| from random import randint | |
| def generate_fr_vat(): | |
| siren = randint(100000000, 999999999) | |
| key = (12 + 3 * (siren % 97)) % 97 | |
| return 'FR' + str(key) + str(siren) | |
| print(generate_fr_vat()) |
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
| /** | |
| * Checks ABN for validity using the published ABN checksum algorithm. | |
| * @author Guy Carpenter | |
| * @license http://www.clearwater.com.au/code None | |
| * @param {String|Number} value abn to validate | |
| * @return {Boolean} Is ABN Valid | |
| */ | |
| function validateABN (value) { | |
| var weights = [10, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19], |
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
| ########################################## | |
| # Helmfile # | |
| # How to manage Kubernetes Helm releases # | |
| # https://youtu.be/qIJt8Iq8Zb0 # | |
| ########################################## | |
| # Referenced videos: | |
| # - K3d - How to run Kubernetes cluster locally using Rancher k3s: https://youtu.be/mCesuGk-Fks | |
| ######### |
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
| <code_scheme name="Airbnb"> | |
| <option name="RIGHT_MARGIN" value="100" /> | |
| <option name="HTML_ATTRIBUTE_WRAP" value="4" /> | |
| <option name="HTML_ELEMENTS_TO_INSERT_NEW_LINE_BEFORE" value="" /> | |
| <option name="HTML_ENFORCE_QUOTES" value="true" /> | |
| <DBN-PSQL> | |
| <case-options enabled="false"> | |
| <option name="KEYWORD_CASE" value="lower" /> | |
| <option name="FUNCTION_CASE" value="lower" /> | |
| <option name="PARAMETER_CASE" value="lower" /> |
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
| hello |
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 numpy as np | |
| import matplotlib.pyplot as plt | |
| from math import exp, log | |
| def getGaussDecayValue(value,origin,scale,decay,offset=0): | |
| # does this work? | |
| z = -1*(scale**2)/(2*log(decay)) | |
| a = (-1* (max(0, abs(value - origin) - offset)**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 numpy as np | |
| import matplotlib.pyplot as plt | |
| from math import exp, log | |
| def getGaussDecayValue(value,origin,scale,decay,offset=0): | |
| # does this work? | |
| z = -1*(scale**2)/(2*log(decay)) | |
| a = (-1* (max(0, abs(value - origin) - offset)**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
| PUT mapping_test | |
| { | |
| "settings": { | |
| "index": { | |
| "number_of_shards": "1", | |
| "refresh_interval": "1s" | |
| } | |
| }, | |
| "mappings": { | |
| "numeric_detection": false, // treat numbers in strings as numbers |
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
| # varnish 4.1 | |
| sudo yum -y install autoconf automake jemalloc-devel libedit-devel libtool ncurses-devel pcre-devel pkgconfig python-docutils python-sphinx graphviz | |
| curl -s https://packagecloud.io/install/repositories/varnishcache/varnish41/script.rpm.sh | sudo bash | |
| wget --content-disposition https://packagecloud.io/varnishcache/varnish41/packages/el/6/varnish-4.1.10-1.el6.x86_64.rpm/download.rpm | |
| sudo rpm -Uvh varnish-4.1.10-1.el6.x86_64.rpm | |
| /usr/sbin/varnishd -V | |
| # varnish 4 | |
| sudo yum -y install autoconf automake jemalloc-devel libedit-devel libtool ncurses-devel pcre-devel pkgconfig python-docutils python-sphinx graphviz |
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
| def col_print(title, array, term_width=150, pad_size=1): | |
| indent = " " * 4 | |
| pad = " " * pad_size | |
| title += "\n" | |
| if not array: | |
| return title + indent + "<None>" | |
| array = list(map(str, array)) # make every element a string | |
| max_item_width = max(map(len, array)) |
NewerOlder