Skip to content

Instantly share code, notes, and snippets.

View digitalhitler's full-sized avatar

Sergey S Petrenko digitalhitler

View GitHub Profile
@digitalhitler
digitalhitler / smali-cheatsheet.txt
Created September 4, 2018 21:20
Smali docs на русском
Небольшая помощь в Smali
(Будет дополняться)
#
Общая информация
#
Smali
Виды(Types)
Байт-код Dalvik имеет два основных класса типов, примитивные типы и ссылочные типы. Типы ссылок - это объекты и массивы, все остальное является примитивным.
@digitalhitler
digitalhitler / Logger.class.js
Last active September 3, 2018 13:38
JS Logger Class
/**
* Logger.class.js: Simple logger based on console wrapper with colors
* and multiple levels
*
* @copyright Copyright (c) 2018 Sergey Petrenko <[email protected]>
* @homepage https://gist.github.com/digitalhitler
* @license MIT
* @version 2.1.0
*
* @history
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
@digitalhitler
digitalhitler / processVideo.sh
Created September 13, 2017 20:19
FFMPEG basic options
ffmpeg -vcodec libx264 -movflags +faststart -threads 0 -r 25 -g 50 -crf 25 -me_method hex -trellis 0 -bf 8 -acodec aac -strict -2 -ar 44100 -ab 128k -f mp4
@digitalhitler
digitalhitler / css-tooltips.css
Created September 12, 2017 22:09
Pure CSS tooltips
/**
(prototype that explains method`s logic)
Usage:
<a href="somewhere" class="with-tooltip" data-tooltip="Всплывашка">A href</a>
*/
@digitalhitler
digitalhitler / xhr-fetch.js
Created May 8, 2017 10:45
JS Fetch & XHR Tools
//
export function toArray(arr = []) {
return Array.prototype.slice.call(arr, 0);
}
//
export function mergeOptions(obj1, obj2) {
var merged = {};
for (var attrname in obj1) { merged[attrname] = obj1[attrname]; }
for (var attrname in obj2) { merged[attrname] = obj2[attrname]; }
################ copy/replace file to ~/.bash_aliases
################ Tuning bash ###########################################################################################
# Command line history
export HISTCONTROL=ignoredups:ignorespace
export HISTFILESIZE=10000000
export HISTSIZE=1000000
shopt -s histappend # Append to the history file, don't overwrite it
shopt -s checkwinsize # Check the window size after each command and, if necessary, update the values of LINES and COLUMNS.
@digitalhitler
digitalhitler / git-grog.sh
Created January 8, 2017 00:48
Git Graphical Log Alias - `git grog`
git config --global alias.grog 'log --graph --abbrev-commit --decorate --all --format=format:"%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(dim white) - %an%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n %C(white)%s%C(reset)"'
@strizhechenko
strizhechenko / porno.md
Last active June 13, 2023 19:24
Код ниже генерирует прекрасные названия, не знаю для чего, новые жанры порно или названия программных проектов.
#!/usr/bin/env bash

if [ ! -f /tmp/linux ]; then
    curl -sS https://www.linux.org.ru/ | egrep -o /tag/[0-9a-z-]+ | sed 's|/tag/||' > /tmp/linux
fi
if [ ! -f /tmp/pron ]; then
    curl -sS http://www.xvideos.com/tags  | egrep -o /tags/[a-z0-9-]+ | sed 's|/tags/||' > /tmp/pron
fi
@digitalhitler
digitalhitler / configure.sh
Last active October 8, 2016 13:11
CentOS Proxmox Dev Machine Auto-Configurator
#!/usr/bin/env bash
yum install -y wget nano openssh-server
systemctl enable sshd.service
systemctl start sshd.service
cd /tmp
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
rpm -ivh epel-release-7-8.noarch.rpm