Skip to content

Instantly share code, notes, and snippets.

View aviskase's full-sized avatar

Yuliya Bagriy aviskase

View GitHub Profile
@aviskase
aviskase / admonition.lua
Last active March 13, 2024 03:52 — forked from jskherman/admonition.lua
A Pandoc Lua filter to convert Callout Blocks to Hugo admonitions (shortcode).
-- Pandoc Lua-filter for Obsidian Callouts
-- Original Source: https://forum.obsidian.md/t/rendering-callouts-similarly-in-pandoc/40020/
-- Notes:
-- Original snippet modified to output Hugo {{< admonition >}} shortcodes with collapse.
-- Make sure to have a blank line before and after the `> [!note]` line of the callout block.
-- The filter works recursively so if you want callouts within callouts, make sure to leave a blank line
-- before and after the `> [!note] Your title here` line of each callout.
-- Usage:
@aviskase
aviskase / dated_monthly.md
Created August 2, 2021 23:02
QuickAdd macro for generating monthly roundups: 1 file per each level 2 heading
tags aliases cssclass
actions/srs

<% tp.file.title%>

{{VALUE}}

function markArchivedAsRead() {
var threads = GmailApp.search('label:unread -label:{inbox, Unsnoozed}');
for (var i=0; i<threads.length; i++)
{
var messages = threads[i].getMessages();
var markUnread = 1;
for (var j=0; j<messages.length; j++)
{
if (messages[j].isInInbox())
markUnread = 0;
@aviskase
aviskase / random_interval_tasks_for_am.gs
Last active May 16, 2020 07:39
Google Apps Script: create tasks in Amazing Marvin in random intervals
// Trigger for this script should be run DAILY
var TARGET_EMAIL = '<AMAZING MARVIN IMPORT EMAIL>';
var MILLIS_PER_DAY = 1000 * 60 * 60 * 24;
var TASKS = [
{ // Task will be created in ranges from 5 to 10 after last created date. E.g. if last created = May 10, next task will be created between May 15 and May 20
id: '<TASK ID>',
range_start: 5,
@aviskase
aviskase / pypi_to_am.gs
Last active May 16, 2020 07:39
Google Apps Script: create task in Amazing Marvin when new version of library appears in pypi
var TARGET_EMAIL = '<AMAZING_MARVIN_IMPORT_EMAIL>';
var LIBRARY_NAME = '<SOME_LIBRARY>'
var URL_LIBRARIES_IO = 'https://libraries.io/pypi/LIBRARY_NAME/versions.atom'
var CATEGORY_OR_PROJECT = '<CATEGORY OR PROJECT IN AMAZING MARVIN>'
function parseXml() {
var props = PropertiesService.getScriptProperties();
var xml = UrlFetchApp.fetch(URL_LIBRARIES_IO).getContentText();
var document = XmlService.parse(xml);
var root = document.getRootElement();
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions
targetNamespace="http://example.com/agreement"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://example.com/agreement"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
@aviskase
aviskase / Postman.desktop
Last active November 21, 2023 20:56
Install Postman
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=postman
Icon=/home/USERNAME/Postman/app/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development;
@aviskase
aviskase / calc-md5-in-base64.groovy
Created June 9, 2016 18:18
Calculate MD5 in Base64
import java.security.MessageDigest
sometext = "123 Document.txt 123"
MessageDigest md = MessageDigest.getInstance("MD5")
md.update(sometext.getBytes())
byte[] enc = md.digest()
String md5Sum = new sun.misc.BASE64Encoder().encode(enc)
@aviskase
aviskase / bash_colors.sh
Last active February 14, 2024 01:43
Custom bash prompt. Sets git branch (colored) and virtualenv
# Reset
Reset='\[\e[0m\]' # Text Reset
# Common colors
Black='\[\e[0;30m\]' # Black
Red='\[\e[0;31m\]' # Red
Green='\[\e[0;32m\]' # Green
Yellow='\[\e[0;33m\]' # Yellow
Blue='\[\e[0;34m\]' # Blue
Purple='\[\e[0;35m\]' # Purple
@aviskase
aviskase / main.java
Last active November 2, 2017 19:00
Домашка по первой неделе для ликбеза по дискретной математики. Решение СЛАУ методом Гаусса.
import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;
class Main {
public static void main(String[] args) {
Solver s = new Solver();
s.solveGaussian();
}