Skip to content

Instantly share code, notes, and snippets.

View 7350206's full-sized avatar
🏠
Working from home

pavel 7350206

🏠
Working from home
  • Sweet Home
  • BY Area
View GitHub Profile
@7350206
7350206 / update-golang.md
Created August 31, 2022 08:16 — forked from nikhita/update-golang.md
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

@7350206
7350206 / index.html
Created March 28, 2022 11:41
LYeyQVO
<button id="btn" onClick="once(doStuff, res2)(1,2,3)">1</button>
<button id="btn" onClick="doStuffOnce(1,2,3)">1-ok</button>
<button id="btn" onClick="once(res1, res2)(100)">2</button>
<button id="btn" onClick="resOnce(100)">2-ok</button>
@7350206
7350206 / index.html
Created March 28, 2022 11:26
LYeyQVO
<button id="btn" onClick="once(doStuff)(1,2,3)">1</button>
<button id="btn" onClick="doStuffOnce(1,2,3)">1-ok</button>
<button id="btn" onClick="once(shout)(100)">2</button>
<button id="btn" onClick="shoutOnce(100)">2-ok</button>
@7350206
7350206 / script.js
Last active March 28, 2022 10:39
MWrmrPW
const main = () => {
const doStuff = (a, b, c) => {
console.log(`done with ${a}, ${b}, ${c}`);
// make smth else
};
const once = (fn) => {
let done = false;
return (...args) => {
if (!done) {
@7350206
7350206 / after_res_hooks.js
Created February 24, 2020 21:37 — forked from pasupulaphani/after_res_hooks.js
Mongoose connection best practices
var db = mongoose.connect('mongodb://localhost:27017/DB');
// In middleware
app.use(function (req, res, next) {
// action after response
var afterResponse = function() {
logger.info({req: req}, "End request");
// any other clean ups
@7350206
7350206 / curl.md
Created February 6, 2020 08:15 — 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.