You (brian) are allowed to change the cleaning code, but nothing else.
Can you reach the throne?
| const gulp = require('gulp') | |
| const rename = require('gulp-rename') | |
| const sharp = require('sharp') | |
| var useAsync = require('gulp-use').async | |
| export default function convertImages () { | |
| return gulp | |
| .src('static/original/uploads/*.*') | |
| .pipe(useAsync(async function (file, next) { | |
| try { |
You (brian) are allowed to change the cleaning code, but nothing else.
Can you reach the throne?
I hereby claim:
To claim this, I am signing this object:
| import _ from 'lodash' | |
| /** | |
| * Map fields of an object: | |
| * | |
| * ``` | |
| * ObjectUtils.mapFields( | |
| * { a: 1, b: 2, c: 3, d: 4 }, | |
| * { | |
| * a: num => num + 10, |
| import currency from 'currency.js'; | |
| // Library docs: https://currency.js.org/ | |
| // We create a custom constructor with custom config here | |
| export function customCurrency(value, options) { | |
| if (value === null || value === undefined) return value; // I don't like that it returns 0.00 | |
| if (!(this instanceof customCurrency)) { // this enables calling the function without 'new' | |
| return new customCurrency(value, options); |
| import _ from 'lodash'; | |
| /** | |
| * Deep diff between two objects - i.e. an object with the new value of new & changed fields. | |
| * Removed fields will be set as undefined on the result. | |
| * Only plain objects will be deeply compared (@see _.isPlainObject) | |
| * | |
| * Inspired by: https://gist.github.com/Yimiprod/7ee176597fef230d1451#gistcomment-2565071 | |
| * This fork: https://gist.github.com/TeNNoX/5125ab5770ba287012316dd62231b764/ | |
| * |
| .ssh_deploy_template: &ssh_deploy_template | |
| # TEMPLATE - see https://docs.gitlab.com/ee/ci/yaml/README.html#anchors | |
| # ... | |
| # Here's the magic to get the code from the GitLab variable into a bash variable and then even executed on an SSH session | |
| script: | |
| # Put gitlab variable into shell variable to improve quote handling | |
| - CMD=$SCRIPT_CMD | |
| # Print for debugging | |
| - echo -e "Executing:\n$CMD" |
| #!/bin/bash | |
| set -e | |
| ################################################# | |
| if [[ $# -ne 1 ]]; then | |
| echo "This script:" | |
| echo "1. resets and initializes the DB on the specified commit/branch" | |
| echo "2. goes back to the codebase you ran this script from" | |
| echo "3. runs the app again" | |
| echo |
| public void testResourceLoad(ResourceLoader resourceLoader) { | |
| System.out.println("resourceLoader k:" + resourceLoader.getResource("keycloak.json").exists()); | |
| System.out.println("resourceLoader /k:" + resourceLoader.getResource("/keycloak.json").exists()); | |
| System.out.println("resourceLoader c:k:" + resourceLoader.getResource("classpath:keycloak.json").exists()); // dev | |
| System.out.println("resourceLoader c:/k:" + resourceLoader.getResource("classpath:/keycloak.json").exists()); // dev | |
| System.out.println("resourceLoader f:k:" + resourceLoader.getResource("file:keycloak.json").exists()); // jar | |
| System.out.println("resourceLoader f:/k:" + resourceLoader.getResource("file:/keycloak.json").exists()); | |
| System.out.println("getClass() k:" + getClass().getResource("keycloak.json")); | |
| System.out.println("getClass() /k:" + getClass().getResource("/keycloak.json")); // dev | |
| System.out.println("getClass() c:k:" + getClass().getResource("classpath:keycloak.json")); |
| # ! install xdotool first - it is needed to check if the terminal is in foreground (or disable that if you don't want) | |
| # then append this to ~/.config/fish/config.fish (create it if not existent) | |
| function alert_cmd_done --on-event fish_postexec | |
| set status_code $status # save for later | |
| set active_window (ps -p (xdotool getwindowpid (xdotool getactivewindow)) -o comm=) # get the process name of the currently active window | |
| if status --is-interactive # Check for interactive session (keyboard attached) | |
| if [ $active_window != "pantheon-termin" -a \ | |
| $CMD_DURATION -a \ | |
| $CMD_DURATION -gt (math "1000 * 5") ] # in background, after a job longer than 5 seconds |