Skip to content

Instantly share code, notes, and snippets.

View jolantis's full-sized avatar

Jonathan van Wunnik jolantis

View GitHub Profile
@jolantis
jolantis / .htaccess
Created June 23, 2010 08:53
my .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
# Don't allow users to view robots.txt file
# RewriteCond %{REQUEST_URI} !^/robots\.txt$
# Force add 'www' to URIs without 'www' (permanent redirect)
# RewriteCond %{HTTP_HOST} ^yourdomainname\.com$ [NC]
# RewriteRule ^(.*)$ http://www.yourdomainname.com/$1 [L,R=301]
@jolantis
jolantis / <head>
Created June 23, 2010 08:49
<head> example
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge;chrome=1"><![endif]-->
<title>Title</title>
<meta name="robots" content="index, follow">
<meta name="description" content="Description.">
@mixin valid-quantity($quantity) {
@if type-of($quantity) != 'number' {
@error 'The "quantity" parameter must be a number!';
}
@if not(unitless($quantity)) {
@error 'The "quantity" parameter must not have a unit!';
}
@if $quantity < 0 {
@error 'The "quantity" parameter must be at least 0!';
}
@jolantis
jolantis / gist:0a1991db917de3b3a423746da0a22e5a
Created December 2, 2016 17:44 — forked from mgmilcher/gist:5eaed7714d031a12ed97
Nginx, PHP-FPM, MySQL and phpMyAdmin on OS X

This is my take on how to get up and running with NGINX, PHP-FPM, MySQL and phpMyAdmin on OSX Yosemite.

This article is adapted from the original by Jonas Friedmann. Who I just discovered is from Würzburg in Germany. A stonesthrow from where I was born ;)

Xcode

Make sure you have the latest version of XCode installed. Available from the Mac App Store.

Install the Xcode Command Line Tools:

xcode-select --install

diff --git a/Contents/Info.plist b/Contents/Info.plist
index 30088e8..1fba4c8 100644
--- a/Contents/Info.plist
+++ b/Contents/Info.plist
@@ -284,6 +284,9 @@
<key>public.filename-extension</key>
<array>
<string>css</string>
+ <string>less</string>
+ <string>scss</string>
<!-- copy this to YOUR_THEME.tmTheme-->
<dict>
<key>name</key>
<string>diff: deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#EAE3CA</string>
@jolantis
jolantis / prefetchbuilder.js
Created October 5, 2015 10:14 — forked from PaulKinlan/prefetchbuilder.js
Code to return link rel=dnsprefetch
(function() {
var requests = window.performance.getEntries();
var hosts = {};
var output = "";
for(var requestIdx = 0; requestIdx < requests.length; requestIdx++) {
var request = requests[requestIdx];
var origin = new URL(request.name).origin;
hosts[origin] = 1;
@jolantis
jolantis / database.php
Created August 26, 2010 10:11
ee2 database.php
<?php
// Setup the environment
if (!defined('EE_ENV')) {
define('EE_SERVER_NAME', $_SERVER['SERVER_NAME']);
if ( strstr( EE_SERVER_NAME, '.local' ) ) define('EE_ENV', 'local');
elseif ( strstr( EE_SERVER_NAME, '.dev' ) ) define('EE_ENV', 'dev');
elseif ( strstr( EE_SERVER_NAME, '.stage' ) ) define('EE_ENV', 'stage');
else define('EE_ENV', 'production');
}
@jolantis
jolantis / ee2_permissions.sh
Created August 16, 2010 18:14 — forked from ryanirelan/ee2_permissions.sh
Sets permssions on a ExpressionEngine 2 install
#!/bin/bash
# File: exp_permissions.sh
# Description: Sets permssions on a ExpressionEngine 2 install
#
# Copyright 2010 George Ornbo (Shape Shed)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@jolantis
jolantis / equal height columns
Created August 16, 2010 10:19
useful CSS snippets
.col {
margin-bottom: -1000px;
padding-bottom: 1000px;
}
For when you want your containers to have the same height. If you are unfamiliar with this technique, I recommend reading Ed Eliot’s article: http://www.ejeliot.com/blog/61