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 | |
# .ebextensions/scripts/db_migrate.sh | |
. /opt/elasticbeanstalk/hooks/common.sh | |
EB_SUPPORT_FILES=$(/opt/elasticbeanstalk/bin/get-config container -k support_files_dir) | |
EB_CONFIG_DOCKER_ENV_ARGS=() | |
while read -r ENV_VAR; do | |
EB_CONFIG_DOCKER_ENV_ARGS+=(--env "$ENV_VAR") |
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
/* | |
Instructions: | |
1 - Open the Jenkins Pipeline View with your browser | |
2 - Open the console and execute the following code | |
3 - Copy the output and paste into your README.md | |
Your github README.md will never be the same ;o) | |
Example: | |
| CI | Build Pipeline: Project Name | | |
|-------------|:------------------------------:| |
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
function i18nLambda (text, render) { | |
text = dict[text] || text | |
return render(text) | |
} | |
var Context = mustache.Context | |
Context.prototype._lookup = Context.prototype.lookup | |
Context.prototype.lookup = function i18nLookup (name) { | |
return (name === 'i18n' ? i18nLambda : this._lookup(name) | |
} |
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
var envVars = JSON.parse($('.code').text()).play2.env_vars | |
, output = [] | |
; | |
Object.keys(envVars).forEach(function (key) { | |
output.push(key + '="' + envVars[key] + '"') | |
}); | |
console.log(output.join(" ")) |
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
# Clean unused images | |
docker image prune | |
# Clean up dangling volumes | |
docker volume rm $(docker volume ls -qf dangling=true) | |
# Stop all containers | |
docker stop $(docker ps -a -q) |
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
/*globals describe, it, context*/ | |
/*jslint node: true, indent: 2*/ | |
'use strict'; | |
var HalBuilder, | |
chai = require('chai'), | |
should = chai.should(), | |
assert = chai.assert, | |
expect = chai.expect, |
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
// http://jsfiddle.net/cKz5u/9/ | |
var handleValidNumber = function (triggerValidation, el) { | |
var n = el.val(), arNumber = n.split(''), | |
isInValid = function(number) { | |
number = parseFloat(number, 2); | |
return number < 10.00 || number > 100.00; | |
}; | |
if (n.length >= triggerValidation && isInValid(n)) { | |
while (isInValid(el.val()) && el.val().length > 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
$(".data").mask("AB/CD/0000", { | |
translation:{ | |
A: {pattern: /[0-3]/}, | |
B: {pattern: /[0-9]/}, | |
C: {pattern: /[0-1]/}, | |
D: {pattern: /[0-9]/}, | |
}, | |
onKeyPress: function(a, b, c, d) { | |
if (!a) return; | |
var m = a.match(/(\d{2})/g); |
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
Object.keys = function (obj, k) { | |
k=[]; | |
for (o in obj) { | |
obj.hasOwnProperty(obj[o]) && (k[k.length]=o); | |
} | |
return k; | |
} |
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
ssh user@host "mysqldump --lock-tables=0 -h HOST -u USER -pPASSWORD --all-databases | gzip -c" > ~/full_mysql_dump.sql.gz |