Skip to content

Instantly share code, notes, and snippets.


Ivan Lokhov ilokhov

View GitHub Profile
ilokhov / build
Created Apr 2, 2018
Build shell script for personal website
View build
# clean dist directory and copy all files from src
rm -rf dist && mkdir dist
cp -a src/. dist/
### images
# declare sizes
declare -a sizes=('710' '1000' '1420')
ilokhov / export-sync-bookmarks.js
Last active May 30, 2022
Node.js script for exporting and synchronising bookmarks from Google Chrome
View export-sync-bookmarks.js
const fs = require("fs");
const path = require("path");
function newItem(name, url) {
return { name, url };
const bookmarkPath = path.join(
"/Library/Application Support/Google/Chrome/Default/Bookmarks"
ilokhov / inject-ie-grid.js
Created Mar 9, 2019
JS script which injects a stylesheet with prefixed CSS grid properties for Internet Explorer
View inject-ie-grid.js
const ua = window.navigator.userAgent;
const isIE = /MSIE|Trident/.test(ua);
if (!isIE) return;
const styleElement = document.createElement("style");
styleElement.setAttribute("type", "text/css");
const grid = { rows: 2, cols: 4 };
let styleContent = `#grid {display: -ms-grid; -ms-grid-columns: (1fr)[${grid.cols}]; -ms-grid-rows: (1fr)[${grid.rows}];}`;
ilokhov / nominatim-reverse-geocode.js
Created Dec 8, 2019
Node.js script for querying city districts for a list of geo coordinates using Nominatim API
View nominatim-reverse-geocode.js
const fs = require('fs');
const request = require('request');
const customHeaderRequest = request.defaults({
headers: { 'User-Agent': 'Reverse geocode search' }
let output = '';
// expected input format in input_data.csv
ilokhov / github-api-search.js
Created Dec 22, 2019
Node.js script for querying GitHub Search API v3
View github-api-search.js
// API docs:
// search docs:
// you might have to limit the number of requests
// if trying to send too many at once
const request = require('request');
const _ = require('lodash');
const fs = require('fs');