Skip to content

Instantly share code, notes, and snippets.

Avatar

Mikhail Turilin mturilin

  • Google
  • San Francisco, CA
View GitHub Profile
@mturilin
mturilin / aspect_ration.fs
Created December 21, 2022 21:17
F# script to compute image aspect ratio
View aspect_ration.fs
open System
let resolutions =
[
((1,1), (1080 , 1080));
((3,2), (1080 , 720));
((4,3), (1024 , 768));
((16,9), (1920 , 1080));
((16,10), (1920 , 1200));
]
View Python Backend Developer Job.md

Backend Developer for Crypto Payments Startup

Looking for a backend developer to crypto payments startup

Who we are?

We are a stealth starup that is working on new generation of money transfer app based on crypto / blockchain technology.

We have senior team with experince of starting mutiple successful businesses.

@mturilin
mturilin / obsidian.css
Created October 31, 2021 23:26 — forked from pihentagy/obsidian.css
Clutter free edit mode
View obsidian.css
/* inline formatting, link targets and [[ ]] disappears if not active line*/
div:not(.CodeMirror-activeline) > .CodeMirror-line span.cm-formatting,
div:not(.CodeMirror-activeline) > .CodeMirror-line span.cm-string.cm-url,
div:not(.CodeMirror-activeline) > .CodeMirror-line span.cm-formatting-link,
div:not(.CodeMirror-activeline)>.CodeMirror-line span.cm-hmd-barelink,
div:not(.CodeMirror-activeline)>.CodeMirror-line span.cm-comment
{ display: none; }
/* hide all html tags -- IT IS COMMENTED OUT BY DEFAULT */
/* div:not(.CodeMirror-activeline) > .CodeMirror-line span.cm-tag{ display: none; } */
@mturilin
mturilin / dedupe.py
Created March 11, 2021 00:34
CVS dedupe
View dedupe.py
import csv
uniques = {}
with open('original.csv') as csv_file:
reader = csv.DictReader(csv_file)
for row in reader:
if row['Password'] == '':
if row['Group'] == 'Root':
row['Group'] = 'Root/Non_Login'
@mturilin
mturilin / logit.scpt
Last active May 19, 2020 03:04
AppleScript
View logit.scpt
to logit(log_string, log_file)
do shell script ¬
"echo `date '+%Y-%m-%d %T: '`\"" & log_string & ¬
"\" >> $HOME/Library/Logs/" & log_file & ".log"
end logit
@mturilin
mturilin / paste_to_devtools_console.js
Created March 29, 2020 22:04
Delete all Google Photos
View paste_to_devtools_console.js
for(i = 1; i<=9999; i++) {
console.log("Iteration # --> " + i);
document.querySelectorAll('div[role=checkbox]').forEach(div=>div.click());
document.querySelectorAll('div[aria-label*="Select all photos"]').forEach(div=>div.click());
await new Promise(r => setTimeout(r, 3000));
try{console.log("Selected documents count for iteration [" + i + "]: " + document.evaluate('/html/body/div[1]/div/c-wiz/c-wiz[2]/span/div[1]/div/span', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.innerText);}catch(ex){/*do nothing*/}
document.querySelector('button[title=Delete]').click();
await new Promise(r => setTimeout(r, 5000));
document.evaluate('//span[text()="Move to trash"]', document, null, XPathResult.ANY_TYPE, null ).iterateNext().click();
@mturilin
mturilin / commands.txt
Created February 9, 2020 20:13
Bonjour - list services
View commands.txt
#
dns-sd -B
# all disconverable services
dns-sd -B _services._dns-sd._udp local.
@mturilin
mturilin / convert.py
Created January 26, 2020 07:44
Converst TextExpander csv to espanso yaml
View convert.py
#!/usr/bin/python3
import yaml
import sys
import csv
# create root yaml
matches = []
# open file
@mturilin
mturilin / hypenation.swift
Created August 12, 2019 18:04
Hypenation in Swift
View hypenation.swift
import Foundation
extension String {
func hungarianHyphenated() -> String {
return hyphenated(locale: Locale(identifier: "hu_HU"))
}
func hyphenated(languageCode: String) -> String {
let locale = Locale(identifier: languageCode)
return self.hyphenated(locale: locale)
@mturilin
mturilin / Readme.txt
Created August 11, 2019 21:52
Duplicate line for XCode
View Readme.txt
sudo subl /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/IDETextKeyBindingSet.plist
add the following:
<key>Customized</key>
<dict>
<key>Duplicate Lines</key>
<string>selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:</string>
<key>Duplicate Current Line</key>
<string>moveToBeginningOfLine:, deleteToEndOfLine:, yank:, insertNewline:, moveToBeginningOfLine:, yank:</string>
</dict>