Skip to content

Instantly share code, notes, and snippets.

View Sparkenstein's full-sized avatar
🐶
Node + Rust = ❤️

Prabhanjan Sparkenstein

🐶
Node + Rust = ❤️
View GitHub Profile
[
{
"Country": "Afghanistan",
"Region": "ASIA (EX. NEAR EAST)",
"Population": 31056997,
"Area (sq. mi.)": 647500,
"Net migration": "23,06",
"GDP ($ per capita)": 700,
"Arable (%)": "12,13",
"Crops (%)": "0,22",
[{
"id": 1,
"full_name": "Ilyssa Pawelek",
"age": 23,
"gender": "Female",
"balance": 12083.74,
"native": "United Kingdom",
"relocate_to": "France",
"family_members": 3
}, {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Untitled benchmark</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>

Keybase proof

I hereby claim:

  • I am sparkenstein on github.
  • I am sparkenstein (https://keybase.io/sparkenstein) on keybase.
  • I have a public key ASBTPnZh-DYM2ScHmsuXsofVJpCxzQ0CGz-xw6RzEid0Bwo

To claim this, I am signing this object:

@Sparkenstein
Sparkenstein / RangeGenerator.js
Created February 25, 2019 09:59
python like range genrator function in js
const range = function* (from, to, step = 1) {
let i = from;
if (from < to) {
while (i + step <= to) {
yield i = i + step;
}
} else {
while (i >= to + step) {
yield i = i - step;
}
@Sparkenstein
Sparkenstein / NumberCustomIterator.js
Created February 25, 2019 09:43
Symbol.iterator on number prototype
const { log } = console;
Number.prototype[Symbol.iterator] = function () {
let i = 0;
const end = this;
return {
next() {
return {
value: i++,
done: i > end,
@Sparkenstein
Sparkenstein / README.md
Last active December 19, 2018 01:45
flameshot post screenshot custom upload hook

Just add the following files at given locations: all credits to @guihkx for solving this issue

save your-uploader.desktop to ~/.local/share/applications/. edit it accordingly. make note of Exec=xxx section. it should be the name of next file save myuploader to either ~/.local/bin/my-uploader or anywhere in your $PATH. edit it accordingly. most probably you don't need to change anything besides the curl command on L20

after saving both files, run update-desktop-database ~/.local/share/applications and chmod a+x /path/to/myuploader

Then, when you take a screenshot with flameshot, just click on icon that says "Choose an app to open the capture". You will see your custom application there Click on it, it will upload the file, and copy the response of server to clipboard.

@Sparkenstein
Sparkenstein / Error
Last active May 21, 2018 18:54
webpack works differently in development and production mode with angularjs
Error
columnNumber: 594
fileName: "http://127.0.0.1:5500/dist/main.js"
lineNumber: 76
message: "[$injector:unpr] Unknown provider: eProvider <- e <- bodyCtrl\nhttp://errors.angularjs.org/1.6.9/$injector/unpr?p0=eProvider%20%3C-%20e%20%3C-%20bodyCtrl"