Skip to content

Instantly share code, notes, and snippets.

View rnarian's full-sized avatar
😱
It's complicated

Marian Friedmann rnarian

😱
It's complicated
View GitHub Profile
@rnarian
rnarian / unflat.js
Last active February 1, 2018 11:18
Simple node script which turns serialized keys in json files into nested json objects
/**
*
* Simple node script which turns serialized keys
* in json file into nested json object
*
* input: {
* "key.key2": "value"
* }
*
* output: {
@rnarian
rnarian / lang.sh
Created January 29, 2018 14:31
Simple bash script that searches for unused i18n strings
#!/bin/bash
declare -a all_labels=(
"GEN_LBL_SALUTATION"
"GEN_LBL_TITLE"
"GEN_LBL_NAME"
"GEN_LBL_FNAME"
"GEN_LBL_LNAME"
"GEN_LBL_ORGA"
"GEN_LBL_POSITION"
@rnarian
rnarian / initconfig.php
Created April 8, 2016 13:48
Contao + Cloudflare Flexible SSL
<?php
// Put your custom configuration here
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && 'https' === $_SERVER['HTTP_X_FORWARDED_PROTO']) {
$_SERVER['HTTPS'] = 1;
}
@rnarian
rnarian / mini-modernizr.html
Created April 5, 2016 12:33 — forked from tomblanchard/mini-modernizr.html
Mini Modernizr: I only ever use Modernizr mostly to check for JS and / or touch screen devices. This tiny piece of code will replace the classes which are on the `<html>` element `no-js` with `js` and `no-touch` with `touch`.
<script>!function(a,b){"use strict";b.documentElement.className=b.documentElement.className.replace("no-js","js"),("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)&&(document.documentElement.className=document.documentElement.className.replace("no-touch","touch"))}(window,document);</script>
@rnarian
rnarian / commit-msg
Last active March 14, 2016 10:26 — forked from stefansundin/install-pre-commit.sh
Git pre-commit check to stop accidental commits to master and develop branches. There is also a variant with a core.whitespace check.
#!/bin/bash
# Stops accidental commits to master and develop. Exceptions to commits starting with "Release".
# https://gist.github.com/rnarian/5bb974bd876beb5de11f
# Install:
# cd path/to/git/repo
# curl -fL -o .git/hooks/commit-msg https://gist.githubusercontent.com/rnarian/5bb974bd876beb5de11f/raw/commit-msg
# chmod +x .git/hooks/commit-msg
BRANCH=`git rev-parse --abbrev-ref HEAD`
MESSAGE=$(cat .git/COMMIT_EDITMSG)
@rnarian
rnarian / .htaccess
Last active August 29, 2015 14:26
Generic htaccess redirect www to non-www
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

Keybase proof

I hereby claim:

  • I am rnarian on github.
  • I am rnarian (https://keybase.io/rnarian) on keybase.
  • I have a public key whose fingerprint is 07F9 6A36 C4E1 7520 8FA5 DC30 B3DF 1563 8A2C 84DB

To claim this, I am signing this object:

@rnarian
rnarian / scope-name
Last active May 22, 2019 21:23
Atom scope name list
source.c
source.c++
source.coffee
source.css
source.css.less
source.css.scss
source.gfm
source.git-config
source.go
source.java
@rnarian
rnarian / upstream.md
Last active July 20, 2018 17:50
fetch upstream

Add upstream repo:

git remote add upstream git://github.com/user/repo.git

Fetch upstream:

git fetch origin -v; git fetch upstream -v; git merge upstream/master


all the colors

for ((color = 0; color <= 255; color++)); do tput setaf "$color"; printf "$color "; done