Skip to content

Instantly share code, notes, and snippets.

View iGhost's full-sized avatar

Gizzat Ablakov iGhost

View GitHub Profile
@iGhost
iGhost / bambook.kg.css
Last active August 18, 2022 14:31
bambook.kg cart styling for Stylus extension
@-moz-document domain("bambook.kg") {
.head,
.body {
padding: 8px !important;
}
.close {
height: 30px !important;
}
.uk-button.uk-button-default.btn-green {
padding: 3px !important;
WIDTH = 80
HEIGHT = 25
def show_map(map)
map.each do |row|
row.each do |cell|
print cell
end
puts ''
end
# Dockerfile - Development environment
# Alpine linux tiny image
FROM ruby:2.7-alpine
MAINTAINER Ghost
ENV INSTALL_PATH /opt/app
RUN mkdir -p $INSTALL_PATH
#nokogiri requirements
RUN apk add --no-cache --update \
from random import randint
MAP_WIDTH = 80
MAP_HEIGH = 24
def show_map(map):
for w in range(len(map)):
for h in range(len(map[0])):
print("{}".format(map[w][h]), end='')
print('')
@iGhost
iGhost / humidity-monitor.cpp
Last active September 4, 2023 16:19
Dim screen backlight depending on photosensor values
#include "microLiquidCrystal_I2C.h"
#include "GyverBME280.h"
#include <DHT.h>
#define ITERATION_MOD 60 // iterations to skip between measurements storing
#define HISTORY_SETS 2
#define HISTORY_SIZE 20
DHT dht22(2, DHT22);
DHT dht11(3, DHT11);
@iGhost
iGhost / backup.sh
Last active August 24, 2022 10:20
PostgreSQL multi database backup script with uploading to AWS S3. Compress using awesome `zstd` tool. This script will backup all available databases on server into separate archive files and upload them to specified bucket in AWS S3
#!/bin/bash
# Installation
#
# from `ubuntu` user:
#
# * install Zstandard compression utility (near 3 times faster than gzip): `sudo apt install zstd`
#
# * install `awscli`: pip install awscli --upgrade --user
#
@iGhost
iGhost / upwork_additional_calculations.js
Created July 20, 2015 08:08
Additional calculations for Upwork reports (GreaseMonkey script)
// ==UserScript==
// @name UpWork additional calculations
// @namespace Ghost
// @include https://www.upwork.com/reports/*
// @version 1
// @grant none
// ==/UserScript==
var myRate = 22;
var wFee100 = 4.95;
#!/bin/bash
lockfile=/tmp/fastcgi_locked
start() {
for user in `ls /var/cpanel/users`; do
if [ -e /home/${user}/public_html/php-fcgi.sock ]; then
echo "Socket exist, exiting!"
exit 0
fi