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
| -- Deleting all customer messages in prestashop written in Russian | |
| -- Search for three most popular russian characters "ΠΎ, Π΅, Π°" | |
| -- Deleting thread info from ps_customer_thread column | |
| delete from | |
| ps_customer_thread | |
| where | |
| id_customer_thread in ( | |
| select | |
| id_customer_thread |
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 | |
| # Script reads configuration values from Prestashop settings, | |
| # and makes database dump into default prestashop backup folder (adminXYZ1234/backups). | |
| function get_parameter_value() { | |
| echo $(cat $PARAMETERS | grep $1 | awk '{print $3}' | sed -e "s/[',]//g") | |
| } | |
| PARAMETERS=../public_html/app/config/parameters.php | |
| DB_NAME=$(get_parameter_value database_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
| float decel(float x) { // as an easing function | |
| return 1-(x-1)*(x-1); | |
| } | |
| void setup() { | |
| background(255); | |
| size(750,750,P2D); | |
| PImage img = loadImage("image.png"); | |
| strokeWeight(2); | |
| noFill(); |
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
| vscode |
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 bpy | |
| import bmesh | |
| import random | |
| from mathutils import Vector, noise, Matrix | |
| from math import sin, cos, tau, pi, radians | |
| from utils.interpolation import * | |
| from easing_functions import * | |
| frame_start = 1 | |
| total_frames = 120 |
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
| // By @coderitual | |
| // https://twitter.com/coderitual/status/1112297299307384833 | |
| // Remove any duplicates from an array of primitives. | |
| const unique = [...new Set(arr)] | |
| // Sleep in async functions. Use: await sleep(2000). | |
| const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms))); | |
| // Type this in your code to break chrome debugger in that line. |
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
| # there is some idea behind it: | |
| # - line with command should be short as possible | |
| # - line with command should be more visibile than first (metadata) line | |
| # - there should be time with seconds, just because | |
| PROMPT=$' \e[90m%n@%m %D{[%H:%M:%S]} [%~]%{$reset_color%} $(git_prompt_info)\ | |
| %(?:%{$bg[green]%}###:%{$bg[red]%}###)%{$reset_color%} ' | |
| ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[" | |
| ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" |
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
| #!/usr/bin/env node | |
| main(); | |
| function main() { | |
| const usageMsg = 'Usage: ...\n'; | |
| // If no STDIN and no arguments | |
| if (process.stdin.isTTY && process.argv.length <= 2) { | |
| process.stderr.write(usageMsg); |
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 | |
| # usage-message.sh | |
| if [ $# -eq 0 ]; then | |
| printf "No arguments provided!\n\n" | |
| cat <<EOF | |
| Script accepts three arguments: | |
| - set of characters to generate (more: man tr) (* required) | |
| - number of charaters to generate (* required) | |
| - length of one line (optional, default: value of second argument) |
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/sh | |
| # Imagemagick analogue of Adobe Photoshop Gradient map with 75% opacity on it | |
| # you will need the input.jpg file with original color image | |
| # and gradient_line.png file with 256 x 1 px image of gradient | |
| # make image grayscale | |
| convert input.jpg -colorspace gray draft.jpg | |
| # apply the gradient lut |