ps -ef
$ curl -i https://git.io
-F "url=https://github.com/smusamashah"
-F "code=smusamashah"
HTTP/1.1 201 Created
Location: https://git.io/smusamashah
-F is for form data. Same can be done with postman. Send a post request, put formdata in body.
List and apply stash
git stash list
git stash apply <n>
git stash pop <n> # apply and remove from stash
is unreliable and expensive call. Does not complete on exact given time. If used in a loop, will slow down
It improves rendering performance A LOT. On-Screen canvas should only be updated with whatever is there in off-screen canvas.
var ctx_onscreen = document.getElementById("cvs").getContext("2d");
var offscreen_canvas = new OffscreenCanvas(100, 100);
var ctx_offscreen = offscreen_canvas.getContext('2d');
// render everything with this ctx_offscreen
// keep updating the on-screen canvas
function renderLoop() {
ctx_onscreen.drawImage(ctx_offscreen.canvas, 0, 0);
requestAnimationFrame(renderLoop);
}
renderLoop();
https://github.com/spite/ccapture.js/
or follow this https://webrtc.github.io/samples/src/content/capture/canvas-record/ its creates a webm video file from canvas without performance hit. you can embed this video or convert it to gif later
make video tag like <video playsinline autoplay></video>
and
var canvas = document.querySelector('canvas');
var video = document.querySelector('video');
var stream = canvas.captureStream();
video.srcObject = stream;
To use Java .jar libraries in groovy, place the jar files in /usr/lib/jvm/java-1.8-openjdk/jre/lib/ext/
. Then you can use import mylib.*
.
To install a module in Jupyter Notebook for Python, use !pip install
(with an exclamation mark) like below
!pip install sklearn