Skip to content

Instantly share code, notes, and snippets.

View lopugit's full-sized avatar

Nikolaj lopugit

View GitHub Profile
lopugit / gist:9b51101c958ef1d9a21936477e651cda
Created May 15, 2022 08:01
Nginx/Valet Homebrew config location
View gist:9b51101c958ef1d9a21936477e651cda
lopugit / postcodeToState.js
Created December 23, 2021 01:48
Get Victorian State code based on a postcode
View postcodeToState.js
const postcode = 9999
let state
if (
(postcode >= 1000 && postcode <= 2599) ||
(postcode >= 2619 && postcode <= 2899) ||
(postcode >= 2921 && postcode <= 2999)
) {
state = 'NSW'
} else if (
(postcode >= 200 && postcode <= 299) ||
lopugit / words.json
Created August 1, 2021 13:34
Just a JSON importable list of over 300,000 english dictionary words
View words.json
This file has been truncated, but you can view the full file.
lopugit / gist:dcff73fe104e5897599972bfcfd8aedd
Created January 29, 2021 04:28
run root command in wsl without starting user session, for recovering broke wsl init configs
View gist:dcff73fe104e5897599972bfcfd8aedd
If you only need to remove the script, try from cmd wsl.exe -u root -e rm /etc/profile.d/
If you have bad startup config in /etc/wsl.conf, perhaps you can run wsl -u root -e mv /etc/wsl.conf /etc/wsl.conf.bak.
EDIT: you know what -u root does, don't you ;) As for -e, it means do not invoke the default login shell and run the rm or mv binaries directly.
lopugit / Launch current node.js file VS code launch.json debugger debug
Created May 13, 2020 12:36
Launch current node.js file VS code launch.json debugger debug
View Launch current node.js file VS code launch.json debugger debug
"type": "node",
"request": "launch",
"name": "Current File",
"program": "${workspaceFolder}/${relativeFile}",
"skipFiles": [
lopugit /
Created December 15, 2019 08:31 — forked from ezeeyahoo/
Launch Chromium with API Keys on Mac OS X and Windows

Sometimes you need to use API Keys to use things like the Speech API. And then you Google a bit and follow all the instructions. But the Chromium Project's API Keys page does a not-so-great of explaining how to do this, so I will.

  1. Download Chromium.[Unofficial/Unstable/Latest build] OR Download from (stable)
  2. You'll notice a yellow disclaimer message appear as a doorhanger: Google API Keys are missing. Some functionality of Chromium will be disabled. Learn More.
  3. Clicking on that link takes you to the confusing API Keys docs page.
  4. If you aren't already, subscribe to the mailing list. (You can just subscribe to the list and choose to not receive any mail. FYI: the C
lopugit / DeterminingFunctionTypes.js
Created December 10, 2019 11:55
Determining function types
View DeterminingFunctionTypes.js
const flags = {
function: f instanceof Function,
name: undefined,
native: false,
bound: false,
plain: false,
arrow: false
if (flags.function) {
lopugit / default.conf
Created June 4, 2019 06:45
NGiNX Configuration for Vue-Router in HTML5 Mode
View default.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
lopugit / 1_primitive_comparison.js
Created May 5, 2019 02:37 — forked from nicbell/1_primitive_comparison.js
JavaScript object deep comparison. Comparing x === y, where x and y are values, return true or false. Comparing x === y, where x and y are objects, returns true if x and y refer to the same object. Otherwise, returns false even if the objects appear identical. Here is a solution to check if two objects are the same.
View 1_primitive_comparison.js
//Primitive Type Comparison
var a = 1;
var b = 1;
var c = a;
console.log(a == b); //true
console.log(a === b); //true
console.log(a == c); //true
console.log(a === c); //true
lopugit / bugs global factory
Created February 20, 2019 12:46
bugs global factory
View bugs global factory
(function (globalThis, factory) {
if (typeof exports === 'object' && typeof module !== 'undefined')
if (typeof global === 'object')
return factory(global)
return factory(exports)
if (typeof define === 'function' && define.amd)
return define(['exports'], factory)