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
/** | |
* Luhn algorithm in JavaScript: validate credit card number supplied as string of numbers | |
* @author ShirtlessKirk. Copyright (c) 2012. | |
* @license WTFPL (http://www.wtfpl.net/txt/copying) | |
*/ | |
var luhnChk = (function (arr) { | |
return function (ccNum) { | |
var | |
len = ccNum.length, | |
bit = 1, |
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
--- | |
--- Usare la nuova versione su https://github.com/carlok/comuni_sql | |
--- | |
CREATE TABLE IF NOT EXISTS regioni ( | |
id int(11) NOT NULL auto_increment, | |
nome varchar(100) NOT NULL, | |
PRIMARY KEY (id) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
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
const cluster = require('cluster'); | |
const http = require('http'); | |
const httpProxy = require('http-proxy'); | |
const _ = require('underscore'); | |
var numCPUs = 10; | |
var isPort = 8080; | |
function estimatePi() { | |
var n = 10000000, inside = 0, i, x, y; |
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
/** | |
* Workaround to make defining and retrieving angular modules easier and more intuitive. | |
*/ | |
(function(angular) { | |
var origMethod = angular.module; | |
var alreadyRegistered = {}; | |
/** |
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
# delete local tag '12345' | |
git tag -d 12345 | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :refs/tags/12345 | |
# alternative approach | |
git push --delete origin tagName | |
git tag -d tagName |
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
- name: Testing variables with SUDO=NO | |
hosts: "*" | |
sudo: no | |
tasks: | |
- name: "PLAYBOOK SUDO=NO, TASK SUDO=NO" | |
command: whoami | |
register: whoami_output | |
sudo: no | |
- debug: var=whoami_output.stdout |
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
describe('validation', function() { | |
['startDate', 'endDate'].forEach(function(key) { | |
it('expects ' + key + ' to be in ISO format', function() { | |
model.set(key, '2014-04-29T15:04:53.078Z'); | |
expect(model.isValid()).toEqual(true); | |
model.set(key, '2014/04/29'); | |
expect(model.isValid()).toEqual(false); | |
}); | |
}); | |
}); |
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
openssl pkcs7 -print_certs -in old.p7b -out new.crt | |
# openssl pkcs7 -print_certs -in old.p7b -out new.cer |
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
// ts 3.6x | |
function debounce<T extends Function>(cb: T, wait = 20) { | |
let h = 0; | |
let callable = (...args: any) => { | |
clearTimeout(h); | |
h = setTimeout(() => cb(...args), wait); | |
}; | |
return <T>(<any>callable); | |
} |
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
kubectl get po --all-namespaces | grep Evicted | awk '{print $2, "--namespace", $1}' | xargs kubectl delete pod |
OlderNewer