Skip to content

Instantly share code, notes, and snippets.

@Amaimersion
Amaimersion / gh2gl.sh
Created February 29, 2024 15:22
Bash script to migrate all repositories from GitHub organization to GitLab group
# This script migrates all repositories from GitHub organization to GitLab group.
#
# Prerequisites:
# - Linux
# - install Git
# - install and auth GitHub CLI
# - install and auth GitLab CLI
# - create target GitLab group
#
# Limitations:
@Amaimersion
Amaimersion / ANSI.md
Created November 2, 2021 14:55 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1b
  • Decimal: 27
@Amaimersion
Amaimersion / main.py
Created September 3, 2020 15:31
Windows Auto Dark Mode
"""
Create windows task to run this script:
1) Add multiple triggers:
- at system startup
- at 9 AM every day (your desired time to disable dark mode)
- at 9 PM every day (your desired time to enable dark mode)
2) Add an action:
Action = Start a program
/**
* Текст поста.
*/
var news_text = [
"Всё меньше причин оставаться ВК.. Ждем пока mail group окончательно загонят сайт в яму и переходим на telegram",
"Дурову пора создавать новый вконтакте, этот уже испортили",
"Прости, Паша, мы все прое*али",
"Ну это уже ни в какие рамки",
"ВКонтакте окончательно загнулись",
"Мда, меилру продолжает губить все, к чему прикасается",
@Amaimersion
Amaimersion / get-non-rendered-text-value.js
Created September 24, 2018 20:14
Gets a text value of non-rendered (i.e. that have `display: none`) element (and it's childs). See more – https://stackoverflow.com/questions/52480730/replace-n-in-non-render-non-display-element-text
/**
* Returns a text value of the element (and it's childs).
*
* @param dcmnt {Document}
* The `document` where an element will be searched for.
*
* @param selector {string}
* A selector by which will be search.
*
* @param separator {string}
@Amaimersion
Amaimersion / 2ch-thread-create.js
Created July 10, 2018 09:50
Функции для создания треда, взятые с 2ch.hk. Версия кэша swag – 35, MD5 всего файла swag – 13d9757cc5e9c9bb5128ec9d48df84c1
/**
* Взято не из файла `swag.js`. Это просто моя заметка.
*
* Это пример полного (?) `FormData` объекта.
* Все записи, полученные с помощью функции `FormData.entries()`:
*
* @example
* > (2) ["task", "post"] // `<input type="hidden" name="task" value="post">`
* > (2) ["board", "pr"] // `<input type="hidden" name="board" value="pr">`
* > (2) ["thread", "0"] // `<input type="hidden" name="thread" value="0">`
@Amaimersion
Amaimersion / 2ch-heading-generation.js
Last active July 10, 2018 09:50
Функции для генерации заголовка, взятые с 2ch.hk. Версия кэша swag – 35, MD5 всего файла swag – 13d9757cc5e9c9bb5128ec9d48df84c1
getTitle: function() {
var element = this.el();
var title = $.trim(element.find('.post-title').text());
if(!title) title = $.trim(element.find('.post-message:first').text());
if(title.length > 50) title = title.substr(0,50) + '...'
return escapeHTML(title);
}
function escapeHTML(str) {
return (str+'')
function InductionMachine()
{
this.memory=[]
this.output_list=[]
this.train=function(i,o)
{
var oo=false;
this.memory.push({input:i,output:o})
for(i7=0;i7<this.output_list.length;i7++)
{