Skip to content

Instantly share code, notes, and snippets.

@bitstarr
bitstarr / split view.md
Created October 9, 2023 09:00
[vs code shortcuts] #vscode

Change the editor split layout from Horizontal to Vertical

You can use a keyboard shortcut if you need to change the editor split layout from horizontal to vertical or vice versa. on Windows and Linux, press Alt + Shift + 0 (zero, no the letter o)

@bitstarr
bitstarr / dontTreadOnMe.js
Created September 6, 2023 12:46
[disable paste event] #JavaScript
const dontTreadOnMe = (e) => e.stopImmediatePropagation();
document.addEventListener('paste', dontTreadOnMe, true);
@bitstarr
bitstarr / custom.js
Created July 7, 2023 14:17
quick custom element with shadow dom #JavaScript
class Test extends HTMLElement {
constructor() {
super();
const sheet = new CSSStyleSheet();
sheet.replaceSync('a { color: green; }'); /* wins!? */
this.attachShadow({mode: 'open'});
this.shadowRoot.adoptedStyleSheets = [sheet];
this.template = document.createElement('template');
this.template.innerHTML = `
<style>
@bitstarr
bitstarr / snippets.json
Last active October 9, 2023 08:59
[Custom Snippets for emmet in VS Code] #vscode
{
"html": {
"snippets": {
}
},
"css": {
"snippets": {
"ar": "aspect-ratio: ${1}",
"bbm": "background-blend-mode: ${1}",
"bs": "block-size: ${1}",
@bitstarr
bitstarr / override.css
Last active November 22, 2022 08:01
fixing mastodon frontend
html {
--accent-light: #c6e0ff;
--accent: #0071af;
--accent-rgb: 0 113 175;
--accent-dark: #003b5e;
}
body {
font-family: system-ui, -apple-system, 'BlinkMacSystemFont', 'Segoe UI', 'Helvetica', 'Arial', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
font-size: 1rem;
line-height: calc( 1em + .35rem );
@bitstarr
bitstarr / snipptes.md
Last active October 24, 2023 09:19
git snippets #git

How to delete all Git branches which have been merged?

To delete all local branches that are already merged into the currently checked out branch:

git branch --merged | egrep -v "(^\*|master|main|dev|develop)" | xargs git branch -d

Maybe you wanto check first for those branches:

@bitstarr
bitstarr / event.html.twig
Last active July 12, 2022 19:39
[grav flex objects details pages] #grav #flex-objects
{% if page.header.flex.id and page.header.flex.router %}
{% set event = grav.get('flex').object( page.header.flex.id, page.header.flex.router )%}
{# {% set event = header.event %} #}
{% endif %}
{% block content %}
<h1 class="headline">
{{ event.title }}
@bitstarr
bitstarr / img.css
Created July 8, 2022 12:17
[HTML/CSS Tips for <img>] #html #css #a11y
img {
background-color: hsl( 0 0% 80% .5);
aspect-ratio: 16 / 9;
}
@bitstarr
bitstarr / .gitconfig
Created March 30, 2022 14:01
[Conditional git profile configuration] #git
// ~/.gitconfig
[user]
name = Sebastian Bille
email = personal@example.com
[includeIf "gitdir:~/code/work/"]
path = ~/code/work/.gitconfig
@bitstarr
bitstarr / vip.md
Last active March 24, 2022 14:19
[Very Important Pens] #CSS #JavaScript #Pattern #Webdesign