Skip to content

Instantly share code, notes, and snippets.

View matijs's full-sized avatar
:dependabot:
Scouting turtles

matijs matijs

:dependabot:
Scouting turtles
View GitHub Profile
@matijs
matijs / README.md
Last active February 22, 2024 05:35
Solarized Dark profile for macOS Terminal.app

Solarized Dark profile for Terminal.app on macOS High Sierra

Based on the excellent Solarized (Dark) created by Ethan Schoonover. For source code, check the main Solarized repository on GitHub.

Installation

Open and save Solarized Dark.terminal.

Import from the “Profiles” tab in the settings of Terminal.app or just double-click the file after downloading.

@matijs
matijs / README.md
Last active April 12, 2023 22:24
Resizing a partition and filesystem on a headless Raspberry Pi running Arch Linux using a USB drive

Resizing a partition and filesystem on a headless Raspberry Pi running Arch Linux using a USB drive

disclaimer: this worked for me, your mileage may vary. Your Pi, your responsibility :)

After putting Arch Linux on a 16GB SD card using these instructions, I ended up with about 14GB of free space.

Arch Linux uses one primary partition (/dev/mmcblk0p1) and an extended partition (/dev/mmcblk0p2) containing one logical partition (/dev/mmcblk0p5). The primary partition is the boot partition and the logical partition is the root partition. Rather than adding another primary partition I just wanted to resize the root partition and filesystem.

According to this bugreport parted no longer handles resizing of partitions and gparted needs a graphical environment to run. So I had to come up with something else to resize my partitions.

@matijs
matijs / makefile
Last active October 1, 2021 12:10
Minimalist makefile using PostCSS
# some variables
POSTCSS = ./node_modules/.bin/postcss
POSTCSS_FLAGS = --use autoprefixer autoprefixer.browsers "> 2%"
# wildcard expansion is performed only in targets and in prerequisites so here we need $(wildcard)
SOURCES = $(wildcard src/css/*.css)
# use $(SOURCES) to determine what we actually need using a bit of pattern substitution
TARGETS = $(patsubst src%, build%, $(SOURCES))
# our default target (see below)
all: $(TARGETS)
;(function(handlers) {
if (!handlers) {
throw new Error('Nothing to handle');
}
document.documentElement.addEventListener('click', function(event) {
var handler = event.originalTarget.getAttribute('data-handler');
if (!handler) {
// nothing to do
return;
@matijs
matijs / README.md
Last active June 13, 2019 09:03
Instructions and example configuration to install BitTorrent Sync on a Raspberry Pi running Arch Linux.

Installing BitTorrent Sync on a Raspberry Pi running Arch Linux

The commands below assume you're using a user that can use sudo, you're not logged in as root are you!?

First create a btsync user:

sudo useradd -M --shell /bin/false --home /var/lib/btsync
@matijs
matijs / classList.js
Last active May 14, 2019 20:44
Element.prototype.classList polyfill
if ( 'document' in self ) {
// Full polyfill for browsers with no classList support
// Including IE < Edge missing SVGElement.classList
if ( !( 'classList' in document.createElement( '_' ) )
|| document.createElementNS && !( 'classList' in document.createElementNS( 'http://www.w3.org/2000/svg', 'g' ) ) ) {
( function( view ) {
'use strict';
var DOMEx;
@matijs
matijs / keybindings.json
Created November 20, 2017 10:41
Visual Studio Code Keybindings
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+shift+k",
"command": "editor.action.deleteLines",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "shift+cmd+k",
"command": "-editor.action.deleteLines",
@matijs
matijs / settings.json
Created November 20, 2017 10:33
Visual Studio Code User Settings
// Place your settings in this file to overwrite the default settings
{
"editor.fontFamily": "Source Code Pro",
"editor.fontSize": 14,
"editor.renderWhitespace": "all",
"editor.renderIndentGuides": false,
"editor.selectionHighlight": false,
"files.insertFinalNewline": true,
"workbench.colorTheme": "Solarized Dark",
"workbench.iconTheme": "vs-minimal",
(function(doc, body) {
const main = doc.querySelector('main').parentNode.removeChild(doc.querySelector('main'));
while (body.firstChild) body.removeChild(body.firstChild);
body.appendChild(main)
}(document, document.body));
@matijs
matijs / sitemap.xml
Created July 11, 2014 15:14
Jekyll sitemap
---
layout: none
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for post in site.posts %}{% unless post.unpublished == false %}<url>
<loc>{{ site.url }}{{ post.url }}</loc>
<lastmod>{% if post.sitemap.lastmod %}{{ post.sitemap.lastmod | date: "%Y-%m-%d" }}{% else %}{{ post.date | date_to_xmlschema }}{% endif %}</lastmod>{% if post.sitemap.changefreq %}
<changefreq>{{ post.sitemap.changefreq }}</changefreq>{% endif %}{% if post.sitemap.priority %}
<priority>{{ post.sitemap.priority }}</priority>{% endif %}