Skip to content

Instantly share code, notes, and snippets.

View simov's full-sized avatar

simo simov

View GitHub Profile
@simov
simov / custome-theme.css
Created April 30, 2024 10:31
Markdown Viewer - Custom Theme
body {
font-family: 'Monospace', monospace;
}
table th { border-bottom: 2px solid; }
table td { border-right: 1px solid; padding: 5px 10px; }
table tr td:last-of-type { border: none; }
@media (prefers-color-scheme: dark) {
@simov
simov / amo-notes-reviewer.md
Last active April 30, 2024 09:42
Notes to the reviewer

Markdown Viewer - Build Instructions

Markdown Viewer is an open source browser extension hosted on GitHub: https://github.com/simov/markdown-viewer/tree/firefox

Build the themes and vendor folders, and create the markdown-viewer.zip package:

cd markdown-viewer/
sh build/package.sh firefox
@simov
simov / keybase.md
Created January 5, 2021 09:04
keybase.md

Keybase proof

I hereby claim:

  • I am simov on github.
  • I am simov (https://keybase.io/simov) on keybase.
  • I have a public key ASCAt2DzuPIz8LZpM4wu7FxNx8F1Q_iBW8SJqqesxDLuOQo

To claim this, I am signing this object:

@simov
simov / devto.js
Created September 8, 2019 12:53
Dev.to Dashboard
var compose = require('request-compose')
// DevTools -> Application -> Cookies
var token = '...'
var parse = (regex, string, map = (a) => a, result = [], match = regex.exec(string)) =>
!match ? result : parse(regex, string, map, result.concat(map(match)))
@simov
simov / prism-javascript.js
Created September 9, 2018 16:35 — forked from RexSkz/prism-javascript.js
JavaScript file highlight for Prism.js (support function arguments)
// current
Prism.languages.javascript = Prism.languages.extend('clike', {
'keyword': /\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,
'number': /\b(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,
// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
'function': /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*\()/i,
'operator': /-[-=]?|\+[+=]?|!=?=?|<<?=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/
});
@simov
simov / README.md
Last active October 8, 2024 11:55
Run `node` scripts using `nvm` and `crontab` without hardcoding the node version

Run node scripts using nvm and crontab without hardcoding the node version

cronjob.env.sh

#!/bin/bash

# NVM needs the ability to modify your current shell session's env vars,
# which is why it's a sourced function
@simov
simov / test-stable-sort.js
Last active February 7, 2018 20:27
Test Stable Sort
// https://github.com/mziccard/node-timsort/#stability
var t = require('assert')
// sorted by weight
var input = [
{ height: 100, weight: 80 },
{ height: 90, weight: 90 },
{ height: 70, weight: 95 },
@simov
simov / server.js
Created January 12, 2018 18:11
Serve static files with NodeJS and Express
var express = require('express')
var serveIndex = require('serve-index')
var serveStatic = require('serve-static')
var app = express()
app.use(serveStatic('/home/s'))
app.use('/', serveIndex('/home/s', {'icons': true, view: 'details'}))
app.listen(8001)
@simov
simov / check-for-git-changes.js
Last active December 31, 2017 17:10
Flat search for changed git repositories: `node check-for-git-changes.js path/to/projects/folder/`
var fs = require('fs')
var path = require('path')
var cp = require('child_process')
if (!process.argv[2]) {
console.log('Specify directory to check')
process.exit()
}
@simov
simov / slack-dark-theme.css
Last active October 4, 2017 12:17
Slack Dark Theme
/*set filter*/
html {
filter: invert(90%) hue-rotate(180deg);
background-color: rgb(25, 25, 25);
}
/*reset*/
img,
.emoji,
.emoji-outer,