Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Martin Folkers S1SYPHOS

🎯
Focusing
View GitHub Profile
@S1SYPHOS
S1SYPHOS / dirmngr.conf
Created Jun 17, 2019
Modern GnuPG Configuration
View dirmngr.conf
##################
# DIRMNGR CONF #
##################
##
# SKS keyserver running as Tor hidden service
# See https://sks-keyservers.net/overview-of-pools.php#pool_tor
keyserver hkp://jirk5u4osbsr34t5.onion
##
@S1SYPHOS
S1SYPHOS / generate_issue.php
Last active Apr 20, 2019
Example script for Fundevogel's recommended novelties, turning CSV & SLA files into optimized PDFs (see https://github.com/Fundevogel/recommended-novelties)
View generate_issue.php
<?php
require_once('vendor/autoload.php');
$currentIssue = '2019_01';
function generateIssue($issue)
{
$src = './src/' . $issue;
View csv-functions.php
<?php
// CSV files > CSV file
function mergeCSV(array $input = [], string $output = '')
{
$count = 0;
foreach (glob($input) as $file) {
if (($handle = fopen($file, 'r')) !== false) {
@S1SYPHOS
S1SYPHOS / svg-url.scss
Created Feb 17, 2018
SASS function to create an inline SVG url() source.
View svg-url.scss
/*
* Replacing SVG strings in data-uri style situations
* by Jakob Erikson -- https://github.com/jakob-e
*
* http://codepen.io/jakob-e/pen/doMoML
*/
// Function to replace characters in a string
@function str-replace($string, $search, $replace: '') {
$index: str-index($string, $search);
@S1SYPHOS
S1SYPHOS / yarn.sh
Created Feb 12, 2018
Installing yarn locally w/o sudo
View yarn.sh
#!/bin/bash
# https://hackernoon.com/how-to-use-yarn-in-a-project-without-installing-yarn-f946815ddb4e
# Choose which version of yarn you want to use
EXPECTED_YARN_VERSION="0.16.1"
function install_yarn {
mkdir -p .yarn
DOWNLOAD_URL="https://github.com/yarnpkg/yarn/releases/download/v$EXPECTED_YARN_VERSION/yarn-v$EXPECTED_YARN_VERSION.tar.gz"
echo "Downloading from $DOWNLOAD_URL"
@S1SYPHOS
S1SYPHOS / submodules_update.sh
Created Jan 22, 2018
These one-liners update all Git submodules at once.
View submodules_update.sh
# Older Git versions
git submodule foreach 'git fetch origin --tags; git checkout master; git pull' && git pull && git submodule update --init --recursive
# Newer Git versions
git submodule update --remote --merge
@S1SYPHOS
S1SYPHOS / gem_reset.sh
Created Jan 22, 2018
This script removes all ruby gems except default ones.
View gem_reset.sh
#!/usr/bin/env ruby
`gem list -d`.split(/\n\n^(?=\w)/).each do |data|
match = data.match(/(?<name>([^\s]+)) \((?<versions>.*)\)/)
name = match[:name]
versions = match[:versions].split(', ')
if match = data.match(/^.*\(([\d\.]*),? ?default\): .*$/)
next if match[1].empty? # it's the only version if this match is empty
versions.delete(match[1] || versions[0])
@S1SYPHOS
S1SYPHOS / config.php
Last active Feb 16, 2018 — forked from joachimesque/config.php
CSP headers with a script-src nonce directive for Kirby
View config.php
<?php
/*
---------------------------------------
HTTP Security headers
---------------------------------------
*/
// Generating CSP nonce & defining CSP header
$csp_nonce = base64_encode(random_bytes(20));
View jekyll-and-liquid.md

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes: