Skip to content

Instantly share code, notes, and snippets.

View OEvgeny's full-sized avatar
🔮
Shading

Eugene OEvgeny

🔮
Shading
View GitHub Profile
@OEvgeny
OEvgeny / bookmarklet.js
Created November 25, 2019 16:22
Bookmarklet to make tables to be todo lists
//javascript:
(() => {
const hash = str => {
let hash = 0,
chr;
for (let i = 0; i < str.length; i++) {
chr = str.charCodeAt(i);
hash = (hash << 5) - hash + chr;
}
return btoa(hash.toFixed(0));
@OEvgeny
OEvgeny / spin.js
Last active August 6, 2019 08:13
Draw Square Spin
function makeSquereSpin(spinRadius, segmentCount = 10, center = [0, 0]) {
const points = [center];
const segmentLength = spinRadius * 2;
let currentPoint = [...center];
let currentRadius = 0;
for (let i = 0; i < segmentCount; i++) {
const currentLength = segmentLength + currentRadius;
currentRadius += segmentLength;
let deviation;
@OEvgeny
OEvgeny / log.txt
Created January 22, 2015 08:38
XBMCLauncher #6 logcat
--------- beginning of /dev/log/main
I/installd( 124): installd firing up
--------- beginning of /dev/log/system
E/DrmService( 126): ----------------running drmservice---------------
I/DEBUG ( 118): debuggerd: May 20 2014 12:52:16
@OEvgeny
OEvgeny / ID.js
Last active August 29, 2015 14:10
// Generate unique IDs for use as pseudo-private/protected names.
// Similar in concept to
// <http://wiki.ecmascript.org/doku.php?id=strawman:names>.
//
// The goals of this function are twofold:
//
// * Provide a way to generate a string guaranteed to be unique when compared
// to other strings generated by this function.
// * Make the string complex enough that it is highly unlikely to be
// accidentally duplicated by hand (this is key if you're using `ID`
@OEvgeny
OEvgeny / syncthing
Last active August 29, 2015 14:10 — forked from arudmin/syncthing
#!/bin/sh
### BEGIN INIT INFO
# Provides: syncthing
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Multi-user daemonized version of syncthing.
@OEvgeny
OEvgeny / aria2
Last active August 29, 2015 14:10 — forked from andrzejressel/aria2
#!/bin/sh
### BEGIN INIT INFO
# Provides: aria2
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: aria2c init script.