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 | |
# .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 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 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 mountImageBossUrl(src, { source, operation, cover_mode, width, height, options }) { | |
var serviceUrl = 'https://img.imageboss.me'; | |
var template = '/:source/:operation/:options/'; | |
if (operation === 'cover') { | |
template = '/:source/:operation::cover_mode/:widthx:height/:options/'; | |
} else if (operation === 'width') { | |
template = '/:source/:operation/:width/:options/'; | |
} else if (operation === 'height') { | |
template = '/:source/:operation/:height/:options/'; |
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
// javascript jpeg decoder: https://github.com/eugeneware/jpeg-js/blob/79c4c7ea876d2e7b46981a563fcc4ae8f9e19849/lib/decoder.js | |
// Determine the JPEG compression quality from the quantization tables: https://github.com/ImageMagick/ImageMagick/blob/59f28acff016f6ae5e8b7e6300bcdf97e94affc9/coders/jpeg.c#L879 | |
// JPEG File Layout and Format: http://vip.sugovica.hu/Sardi/kepnezo/JPEG%20File%20Layout%20and%20Format.htm | |
// jpeg constants: https://github.com/LuaDist/libjpeg/blob/6c0fcb8ddee365e7abc4d332662b06900612e923/jpeglib.h#L45 | |
function getQuantizationTables(data) { | |
var quantizationTables = [] | |
var dctZigZag = new Int32Array([ |
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
[alias] | |
pair = !git config user.name \"Igor & $1\" | |
unpair = config --unset-all user.name |
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
# This bash script will update your PS1 configuration to inform you about: | |
# - current hour | |
# - current logged user | |
# - machine name | |
# - current path | |
# - status of current branch: | |
# - untracked files | |
# - uncommited changes | |
# - when nothing is changed on current branch | |
# - inform you when the current user.name and user.email is different of the global settings |
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
git config alias.spush='!sh -c "mvn clean test && git push \$1 \$2 \$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
# 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 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
-- https://wiki.postgresql.org/wiki/Fixing_Sequences | |
SELECT 'SELECT SETVAL(' || | |
quote_literal(quote_ident(PGT.schemaname) || '.' || quote_ident(S.relname)) || | |
', COALESCE(MAX(' ||quote_ident(C.attname)|| '), 1) ) FROM ' || | |
quote_ident(PGT.schemaname)|| '.'||quote_ident(T.relname)|| ';' | |
FROM pg_class AS S, | |
pg_depend AS D, | |
pg_class AS T, | |
pg_attribute AS C, | |
pg_tables AS PGT |
NewerOlder