Skip to content

Instantly share code, notes, and snippets.

View peterbartha's full-sized avatar
🧑‍🚀

Peter Bartha peterbartha

🧑‍🚀
View GitHub Profile
@peterbartha
peterbartha / README.md
Last active April 22, 2024 17:57
Convert Rust books to EPUB (incl. The Rust Programming Language)

Convert Rust books to EPUB (incl. The Rust Programming Language)

The following steps work for all the HTML learning materials on the Learn Rust page:

  1. Click on the "Print this book" icon in the top right corner.
  2. "Cancel" print popup.
  3. Press F12.
  4. Copy, paste, and run the contents of ebookFormatPreparation.js into your browser's console.
  5. Save the modified HTML file.
@peterbartha
peterbartha / fragmentParser.js
Last active December 15, 2020 10:57
Parsing (decoded) fragment params like query string params
/**
* If you're working with URL encoded fragments you should probably use URLSearchParams(...) instead of this
* solution. Read more: https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
*/
const { hash } = location;
const params = new Map(hash.slice(1, hash.length).split('&').filter(elem => elem).map(elem =>
elem.split('=').map(e => decodeURIComponent(e))
));
// example:
@peterbartha
peterbartha / spookyd.js
Created November 2, 2020 14:27
nCore spo0ky day(s) auto clicker
/**
* Az alábbi kód az nCore oldalon Haloween környékén meghirdetett eseménynél
* segít némi plusz pontot, kevesebb seed időt elérni.
*
* A `Conditional breakpoint` kommentek utáni kódot Chrome/Firefox böngészők
* debuggerében a komment alatti sorokra kell felvenni. A `false` minden sor
* végén azt eredményezi, hogy nem áll majd meg a kód futás a beírt kód
* kiértékelését követően (igaz érték esetén megáll a breakpointon).
*
* Használjátok, DE! nagyon szépen kérlek benneteket, NE! használjátok "túl",
@peterbartha
peterbartha / travis-swagger.json
Last active April 27, 2018 02:09
Travis CI Swagger 2.0 config
{
"swagger": "2.0",
"info": {
"description": "Travis CI is a hosted continuous integration and deployment system. You can find out more about Travis at [https://developer.travis-ci.com](https://developer.travis-ci.com).",
"version": "3.0.0",
"title": "TravisHub",
"termsOfService": "https://billing.travis-ci.com/pages/terms",
"contact": {
"email": "mail@peterbartha.com"
},
@peterbartha
peterbartha / .editorconfig
Last active November 4, 2022 12:46
My go-to .editorconfig file
# http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true