Skip to content

Instantly share code, notes, and snippets.

View ibqn's full-sized avatar

Evgeny Bobkin ibqn

  • Europace AG
  • Berlin - Deutschland
View GitHub Profile
@ibqn
ibqn / PlayStationBIOSFilesNAEUJP.md
Created March 18, 2024 20:53 — forked from juanbrujo/PlayStationBIOSFilesNAEUJP.md
Files for PlayStation BIOS Files NA-EU-JP
@ibqn
ibqn / index.html
Created November 26, 2022 22:28 — forked from diegoquintanav/index.html
How to pass variables from html script tags to the react.js DOM
<div id="container" data-stuff="my variable">
<!-- This element's contents will be replaced with your component. -->
</div>
<script>
window.test = "my react test";
window.dumbname = "martin"
// notice that `stuff` is not passed directly, it is passed using `data-stuff="my variable"` through `container.dataset`
</script>

How to optimize SVG

Editors like Illustrator can save out some really dumb SVG code sometimes. Properly optimized SVG files can be as much as 80% smaller. Bunches of empty groups, pointless attributes and many other inefficiencies decrease readability and reliability.

Every SVG file should be manually optimized in 3 passes using:

  1. Your vector graphic editor.
  2. The SVGO command-line optimization tool.
  3. Your text editor.
@ibqn
ibqn / browser-ndjson-stream-reader.js
Created January 28, 2022 22:12 — forked from ornicar/browser-ndjson-stream-reader.js
Read a ND-JSON stream from the browser or from nodejs
/* FOR THE BROWSER
Utility function to read a ND-JSON HTTP stream.
`processLine` is a function taking a JSON object. It will be called with each element of the stream.
`response` is the result of a `fetch` request.
See usage example in the next file.
*/
const readStream = processLine => response => {
const stream = response.body.getReader();
const matcher = /\r?\n/;
@ibqn
ibqn / depgen.py
Last active July 17, 2020 10:57 — forked from rcludwick/depgen.py
Python ordering a build list by giving a dictionary of dependencies.
"""
These functions take a dictionary of dependencies in the following way:
depdict = {
'a' : [ 'b', 'c', 'd'],
'b' : [ 'c', 'd'],
'e' : [ 'f', 'g']
}
has_loop() will check for dep loops in the dep dict with true or false.
flatten() will create an ordered list of items according to the dependency structure.
Note: To generate a list of dependencies in increasing order of dependencies, say for a build, run: flatten(MyDepDict)
@ibqn
ibqn / index.html
Created May 11, 2020 17:58
Tic Tac Toe
<div id="errors" style="
background: #c00;
color: #fff;
display: none;
margin: -20px -20px 20px;
padding: 20px;
white-space: pre-wrap;
"></div>
<div id="root"></div>
<script>

This answer is partially inspired by the post by @Saucier, but I was looking for an automated way to set user.name and user.email on a per repo basis, based on the remote, that was a little more light weight than the git-passport package that he developed. Also h/t to @John for the useConfigOnly setting. Here is my solution:

.gitconfig changes:

[github]
    name = <github username>
    email = <github email>
[gitlab]
    name = <gitlab username>
    email = <gitlab email>

In your ~/.ssh/config (if this file doesn't exist, just create it):

Host *.bitbucket.org 
    StrictHostKeyChecking no

This will turn it off for all hosts you connect to. You can replace the * with a hostname pattern if you only want it to apply to some hosts.

Make sure the permissions on the file restrict access to yourself only:

@ibqn
ibqn / setup.md
Created January 31, 2020 19:47
Setup VSCode with Live Server and a Docker container

Setup VSCode with Live Server and a Docker container

In this I will shortly describe how to setup

I used a docker-compose.yml file although I only created one container with no other dependencies. This works with a regular Dockerfile as well.

@ibqn
ibqn / clean-up-boot-partition-ubuntu.md
Created November 11, 2019 09:49 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r