Skip to content

Instantly share code, notes, and snippets.

View nicroto's full-sized avatar

Nikolay Tsenkov nicroto

View GitHub Profile
@nicroto
nicroto / reproduce-issue.ts
Created April 20, 2024 07:32
tsx can't run/transpile endent
import endent from 'endent';
const stringProcessor = (str: TemplateStringsArray) => {
return ` ${str.join()}`;
};
function main() {
// console.log(stringProcessor`test`); // this works
console.log(endent`test`); // this FAILS
}
@nicroto
nicroto / server.js
Created September 27, 2016 14:46
NodeJS server for a single-page app with client navigation and no backend.
'use strict';
var http = require( "http" ),
pathUtils = require( "path" ),
express = require( "express" ),
app = express(),
PORT = process.env.PORT || 5000,
appDir = pathUtils.resolve( __dirname, "client" );
app.use( express.static( appDir ) );
@nicroto
nicroto / curl.md
Created July 8, 2018 16:14 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@nicroto
nicroto / docker-cleanup-resources.md
Created June 22, 2018 15:15 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@nicroto
nicroto / 1_kubernetes_on_macOS.md
Created June 1, 2018 08:39 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

Wed May 23 08:15:30 UTC 2018
@nicroto
nicroto / data.txt
Last active December 23, 2015 14:59
1 1:27.628986211005284 2:39.60655028819187 3:33.96808888423929 4:46.207622664139166 5:238.14551568720367 6:44.01392695586554 7:42.4435318282687 8:16.900909745351484 9:24.335965104964547 10:87.24153380273698 11:72.95352551822221 12:51.19035073570972 13:22.46317244641647 14:50.118375641713044 15:112.65549852413099 16:119.27983933214045 17:54.40325577950885 18:24.35533936795781 19:19.90313580028921 20:51.267013505272175 21:17.48772174689688 22:27.50953599118038 23:30.109956792230943 24:18.390043555031905 25:34.155693378726255 26:80.73981778128378 27:33.24333166306527 28:26.935545698925274 29:17.36079456353314 30:48.983669635951244 31:41.68283544255993 32:9.353672998341303 33:29.982739610850675 34:11.105770615186842 35:31.111570122023824 36:95.75863589861028 37:17.94472961876644 38:56.43927112290222 39:14.143933642021894 40:2.536914854803267 41:31.878834102331886 42:28.125058388947192 43:49.741145229198786 44:7.668971667142916 45:62.260351611260205 46:77.4985501716542 47:35.28014363214608 48:82.1460103814674 49:4
Process: SafariForWebKitDevelopment [28824]
Path: /Applications/Safari.app/Contents/MacOS/SafariForWebKitDevelopment
Identifier: com.apple.Safari
Version: 9.0 (11601.1.56)
Build Info: WebBrowser-7601001056000000~2
Code Type: X86-64 (Native)
Parent Process: WebProcess [28821]
Responsible: SafariForWebKitDevelopment [28824]
User ID: 502
div.article-body p {
color: #050505;
}
a.external {
color: #4385a3;
}
h1, h2, h3 {
color: #080808;
@nicroto
nicroto / 1-reproduce-test.js
Last active August 29, 2015 13:57
PhantomJS crash when using node-phantom (report, code reproducing the issue)
'use strict';
var pathUtils = require("path"),
http = require("http"),
nodePhantom = require('node-phantom'),
should = require('should'),
phantomPath = pathUtils.resolve( pathUtils.join( __dirname, "../bin/phantomjs" ) ),
phantom;
var server = http.createServer( function(request,response) {