Skip to content

Instantly share code, notes, and snippets.

@stefthoen
stefthoen / Gruntfile.js
Last active December 31, 2015 05:39
Gruntfile.js for Paprika Patterns.
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner:
'/*! <%= pkg.name %>.js v<%= pkg.version %>\n' +
' * http://<%= pkg.name %>.com/\n' +
' *\n' +
' * <%= pkg.description %>\n' +
@stefthoen
stefthoen / vim_cheatsheet
Last active December 29, 2015 19:29
Vim cheatsheet
# Smart movements
* and # search for the word under the cursor forward/backward.
w to the next word
W to the next space-separated word
b / e to the begin/end of the current word. (B / E for space separated only)
gg / G jump to the begin/end of the file.
% jump to the matching { .. } or ( .. ), etc..
{ / } jump to next paragraph.
'. jump back to last edited line.
g; jump back to last edited position.
@stefthoen
stefthoen / list.php
Created November 18, 2013 16:36 — forked from rutger1140/list.php
<?php
require('config.php');
$db = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE);
$db->set_charset('utf8');
$result = $db->query('SELECT *, DATE(redirect.date) AS shortdate FROM redirect ORDER BY redirect.date DESC');
// If we have no results
if ($result && $result->num_rows < 0) die('No results');
@stefthoen
stefthoen / gist:7245510
Created October 31, 2013 07:22
Cronjob for InfiniteWP hosted on Webfaction
*/20 * * * * /usr/local/bin/php -q -d safe_mode=Off /home/baardbaard/webapps/infinitewp/cron.php >/dev/null 2>&1
@stefthoen
stefthoen / baardbaard-256.vim
Created October 8, 2013 10:00
Baardbaard Vim color scheme for 256 color terminals
" Vim color file
" Name: baardbaard-256
" Author: Baardbaard
set background=dark
set t_Co=256
let g:colors_name="baardbaard-256"
let python_highlight_all = 1
let c_gnu = 1
@stefthoen
stefthoen / tint-mixin.scss
Created September 19, 2013 14:54
Sass tint mixin
// Add percentage of white to a color
@function tint($color, $percent) {
@return mix(white, $color, $percent);
}
// Add percentage of black to a color
@function shade($color, $percent) {
@return mix(black, $color, $percent);
}
@stefthoen
stefthoen / .gitignore
Last active December 20, 2015 22:59
Unity gitingore file.
obj
Temp
*.tmproj
*.csproj
*.unityproj
*.sln
*.suo
*.user
*.pidb
*.userprefs
@stefthoen
stefthoen / .htaccess
Created August 10, 2013 11:38
.htaccess for WordPress.
# Apache configuration file
# httpd.apache.org/docs/2.2/mod/quickreference.html
# Note .htaccess files are an overhead, this logic should be in your Apache config if possible
# httpd.apache.org/docs/2.2/howto/htaccess.html
# Techniques in here adapted from all over, including:
# Kroc Camen: camendesign.com/.htaccess
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
# Sample .htaccess file of CMS MODx: modxcms.com
<ifModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml text/css application/xhtml+xml text/css text/javascript application/javascript application/x-javascript
</ifModule>
@stefthoen
stefthoen / .gitignore
Last active December 20, 2015 16:59 — forked from redoPop/.gitignore
Gitignore for WordPress.
# Ignore everything in the root except the "wp-content" directory.
/*
!.gitignore
!wp-content/
# Ignore everything in the "wp-content" directory, except the "plugins"
# and "themes" directories.
wp-content/*
!wp-content/plugins/
!wp-content/themes/