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 / mailtest.php
Last active December 21, 2015 22:59
Testing html mails like a boss! Call: mailtest.php?mail=receiver.mail@host.com
<?php
$mail = $_GET['mail'];
$message = file_get_contents("mail.html");
$header = "MIME-Version: 1.0\n";
$header .= "Content-type: text/html; charset=utf-8\n";
$header .= "From: Marian Friedmann <marian.friedmann@gmail.com>\n";
mail($mail,"Mail Test", $message, $header);
?>
@rnarian
rnarian / _px-to-rem.scss
Created February 14, 2014 16:23
SCSS Mixin for using rem with px fallback.
/**
* _px-to-rem.scss
*
* Author: Marian Friedmann
*
* Usage:
* .element {
* @include px-to-rem(padding, 0 24px)
* }
*
@rnarian
rnarian / 0_reuse_code.js
Created February 20, 2014 08:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@rnarian
rnarian / package.json
Created February 23, 2014 21:00
Minimal package.json
{
"name": "wat",
"description": "wat",
"version": "0.0.1",
"private": true
}
@rnarian
rnarian / Gruntfile.js
Created February 24, 2014 10:06
Gruntconfig + package.json
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
dirs: {
bower: 'bower_components',
css: 'assets/css',
js: 'assets/js',
images: 'assets/images',
@rnarian
rnarian / shorthand-if-else
Last active August 29, 2015 13:56
PHP Shorthand if/else
$is_admin = ($user['permissions'] == 'admin' ? true : false);
echo 'Welcome '.($user['is_logged_in'] ? $user['first_name'] : 'Guest').'!';
@rnarian
rnarian / minimal-ui.html
Created March 11, 2014 09:20
“minimal-ui” mode hides the bottom navigation and shrinks the address bar of mobile Safari. To enable it, add minimal-ui to the viewport meta tag. Safaris button navigation will only be visible, when the user taps the address bar. This is especially important if a website has a navigation at the bottom of the page, as one would have to tap twice…
<meta name="viewport" content="minimal-ui">
<meta name="viewport" content="width=device-width,minimal-ui">
@rnarian
rnarian / funny-console-log.js
Created March 31, 2014 14:28 — forked from cfj/console.reverselog.js
Reverse console.log
var _log = console.log;
window.console.log = function(log){
_log.call(console, log.reverse ? log.reverse() : typeof log === 'string' ? log.split('').reverse().join('') : typeof log === 'number' ? log.toString().split('').reverse().join('') : log);
};

all the colors

for ((color = 0; color <= 255; color++)); do tput setaf "$color"; printf "$color "; done
@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