# Sometimes when you run sorry-cypress | |
# and have misconfigured UI which has | |
# http://localhost:4000 as baseUrl for API backend | |
# and need to create new project ASAP | |
# without digging into docs and sources | |
curl 'http://<your_ip_address>:4000/' \ | |
-H 'sec-ch-ua: "Google Chrome";v="105", "Not)A;Brand";v="8", "Chromium";v="105"' \ | |
-H 'accept: */*' \ | |
-H 'Referer: http://<your_ip_address>:8080/' \ |
class Router { | |
constructor({ | |
pages, | |
rootSelector | |
}) { | |
this.pages = pages; | |
this.rootSelector = rootSelector; | |
this.initRouting(); | |
} |
/** | |
* Helper function to get image type based on starting bytes of the image file. | |
*/ | |
function getImageType(content) { | |
// Classify the contents of a file based on starting bytes (aka magic number: | |
// https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files) | |
// This aligns with TensorFlow Core code: | |
// https://github.com/tensorflow/tensorflow/blob/4213d5c1bd921f8d5b7b2dc4bbf1eea78d0b5258/tensorflow/core/kernels/decode_image_op.cc#L44 | |
if (content.length > 3 && content[0] === 255 && content[1] === 216 && | |
content[2] === 255) { |
- Get node binary (node.exe) from http://nodejs.org/download/
- Create the folder where node will reside and move node.exe to it
- Download the last zip version of npm from http://nodejs.org/dist/npm
- Unpack the zip inside the node folder
- Download the last tgz version of npm from http://nodejs.org/dist/npm
- Open the tgz file and unpack only the file bin/npm (without extension) directly on the node folder.
- Add the the node folder and the packages/bin folder to PATH
- On a command prompt execute
npm install -g npm
to update npm to the latest version
Now you can use npm and node from windows cmd or from bash shell like Git Bash of msysgit.
git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )
This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph.
import { serve } from "https://deno.land/std@v0.30.0/http/server.ts"; | |
const s = serve({ port: 8000 }); | |
console.log("http://localhost:8000/"); | |
for await (const req of s) { | |
req.respond({ body: "Hello World\n" }); | |
} |
Eric Bidelman has documented some of the common workflows possible with headless Chrome over in https://developers.google.com/web/updates/2017/04/headless-chrome.
If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.
Well, this fun moment when you're trying to follow the answer from stackoverflow =)
https://stackoverflow.com/questions/45141402/build-and-run-dockerfile-with-one-command
dvat@dvat-test:~/dvat-artp$ docker run --rm -it $(docker build -q .)
free(): invalid pointer
SIGABRT: abort
PC=0x7f01fd8c8e97 m=0 sigcode=18446744073709551610
signal arrived during cgo execution
// Source of https://www.npmjs.com/package/physical-cpu-count | |
'use strict' | |
const os = require('os') | |
const childProcess = require('child_process') | |
function exec (command) { | |
const output = childProcess.execSync(command, {encoding: 'utf8'}) | |
return output |