Skip to content

Instantly share code, notes, and snippets.

View devxom's full-sized avatar

Ilía Reshetnikov devxom

View GitHub Profile
@devxom
devxom / obsidian-web-clipper.js
Created May 10, 2024 01:34 — forked from kepano/obsidian-web-clipper.js
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/[email protected]?module'), import('https://unpkg.com/@tehshrike/[email protected]'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@devxom
devxom / gist:b22bfb1aa933bf4a978b09300340ccdc
Created July 30, 2019 07:42 — forked from bessarabov/gist:674ea13c77fc8128f24b5e3f53b7f094
One-liner to generate data shown in post 'At what time of day does famous programmers work?' — https://ivan.bessarabov.com/blog/famous-programmers-work-time
git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }'
// easing functions http://goo.gl/5HLl8
Math.easeInOutQuad = (t, b, c, d) => {
t /= d/2;
if (t < 1) {
return c/2*t*t + b
}
t--;
return -c/2 * (t*(t-2) - 1) + b;
};
git log --oneline $(git describe --tags --abbrev=0 @^)..@
@devxom
devxom / gist:873f17580c36edfafbd5b3215a25b1d1
Last active February 17, 2018 22:34
Fix watch problem Waiting...Fatal error: watch ENOSPC
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

location = location

... and a 534 other ways to reload the page with JavaScript

location = location
location = location.href
location = window.location
location = self.location
location = window.location.href
location = self.location.href
@devxom
devxom / license-badges.md
Created September 17, 2017 16:31 — forked from lukas-h/license-badges.md
License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • Badges are made with Shields.io.
  • This badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.  
  • 🇫🇷 Cette liste en français
@devxom
devxom / CaptureScreen.c
Created February 1, 2017 19:53
Capture screen [c/c++]
// source: web.archive.org/web/20140326200825/http://it-talk.org/topic2646.html
void CaptureScreen(HWND window)
{
RECT windowRect;
GetWindowRect(window, &windowRect);
int bitmap_dx = windowRect.right-windowRect.left;
int bitmap_dy = windowRect.bottom-windowRect.top;
@devxom
devxom / unrpm.sh
Created August 8, 2016 17:08
Unpack an rpm into a build dir #fedora #centos #rpm
#!/bin/bash
# $Id: unrpm 4036 2010-04-13 23:16:41Z agriffis $
#
# unrpm: unpack an rpm into a build dir
#
# Copyright 2007 Aron Griffis <[email protected]>
# Released under the GNU General Public License v2
#
main() {