Skip to content

Instantly share code, notes, and snippets.

View ip413's full-sized avatar
πŸŽƒ

ip413 ip413

πŸŽƒ
  • Poland
View GitHub Profile
-- 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
#!/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)
@ip413
ip413 / 50_lines.pde
Created May 6, 2020 12:48 — forked from u-ndefine/50_lines.pde
Sketch of my generative art, "50 Lines"
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();
@ip413
ip413 / attractors.py
Created February 20, 2021 22:03 — forked from ylegall/attractors.py
code for animating strange attractors in blender
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
@ip413
ip413 / oneliners.js
Created February 23, 2021 10:23 — forked from ghostcode/oneliners.js
πŸ‘‘ Awesome one-liners you might find useful while coding.
// 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.
@ip413
ip413 / oregon.zsh-theme
Last active May 20, 2021 07:40
zsh theme
# 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%}"
@ip413
ip413 / read_arguments.js
Last active May 29, 2021 17:13 — forked from ishu3101/read_arguments.js
Accept input via stdin and arguments in a command line application in node.js
#!/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);
#!/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)
#!/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