Skip to content

Instantly share code, notes, and snippets.

View gmelikov's full-sized avatar
:octocat:
Githubing

George Melikov gmelikov

:octocat:
Githubing
View GitHub Profile
// ==UserScript==
// @name Google meet change account
// @namespace https://gmelikov.com/
// @version 0.1
// @description Autochange google account, if not defined
// @author Gmelikov
// @match https://meet.google.com/*
// @grant none
// ==/UserScript==
// ==UserScript==
// @name Fix Webogram width
// @namespace webogram.fixes
// @match https://web.telegram.org/*
// @version 2
// @grant none
// ==/UserScript==
function addGlobalStyle(css) {
var head, style;
@gmelikov
gmelikov / trello_json_to_txt.py
Created May 14, 2020 13:24
Convert trello json into text
#!/usr/bin/env python3
import json
import sys
def main():
with open(sys.argv[1]) as infile:
data = json.load(infile)
lists = {}
@gmelikov
gmelikov / fill_screen.html
Last active January 30, 2018 13:09
html autozoom page for screen width
Add to <head>:
```
<meta id="Viewport" name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<script type="text/javascript">
var ww=320; //maximum body size in pixels
var ratio = window.innerWidth / ww;
document.querySelector('meta[name="viewport"]').setAttribute("content", 'initial-scale=' + ratio + ', maximum-scale=' + ratio + ', minimum-scale=' + ratio + ', user-scalable=yes, width=' + ww);
</script>
```
@gmelikov
gmelikov / linux_intel_nvidia_cuda_overclock.md
Last active January 21, 2018 11:03
Linux: intel GPU as main and nvidia GPUS as CUDA with overclock

Main problem - nvidia-settings needs nvidia GPUs to be started in X.

Workaround - fake displays for nvidia driver in xorg.conf:

  1. nvidia-xconfig --enable-all-gpus

  2. edit /etc/X11/xorg.conf:

...
@gmelikov
gmelikov / equalheight.js
Last active April 13, 2017 13:59
js function - Make inline divs the same height and fill it.
/**
* Make inline divs the same height and fill it.
* @param {string} container - selector string of parent container.
* @param {string} [blocktobottom] - selector string of object to fill height.
*/
equalheight = function(container, blocktobottom) {
function fillinside($el, currentTallest, blocktobottom) {
if (typeof blocktobottom !== 'undefined' && $el.height() < currentTallest) {
$el.find(blocktobottom).css('padding-top', ((currentTallest - $el.height()) + parseInt($el.find(blocktobottom).css('padding-top'), 10)));
@gmelikov
gmelikov / AppResolver.php
Last active November 16, 2015 05:57
asterisk+phpdaemon
<?php
/**
* Default application resolver
*
* @package Core
* @author Zorin Vasily <maintainer@daemon.io>
*/
class MyAppResolver extends \PHPDaemon\Core\AppResolver {

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs