Skip to content

Instantly share code, notes, and snippets.

View wikitopian's full-sized avatar

wikitopian wikitopian

View GitHub Profile
@wikitopian
wikitopian / wp-config-snippet.php
Created September 4, 2017 23:21
Address Neutrality Tweak
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
$_SERVER['HTTPS'] = 'on';
function isSecure() {
return(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443;
}
$web_site = $_SERVER['HTTP_HOST'];
$schema = isSecure() ? 'https://' : 'http://';
$web_site_url = $schema . $web_site;
#!/bin/bash
find $1 -type f | sed -e "s#$1\(.*\)#rm -f \\1#g" | bash
find $1 -type f | sed -e "s#$1\(.*\)\/\(.*\)#mkdir -p \\1#g" | bash
find $1 -type f | sed -e "s#$1\(.*\)#ln -s $PWD\/fs\1 \1#g" | bash
@wikitopian
wikitopian / retard-races
Created November 16, 2013 15:44
Races of the World (Retard Edition)
A taxonomically complete summary of the world's races, as perceived by the cognitively challenged
Americans
---------
* White Americans
* Canadians
* Brits
* Aussies
* Kiwis
Host *
ControlPath ~/.ssh/master-%l-%r@%h:%p
Compression yes
ControlMaster auto
ServerAliveInterval 10
ServerAliveCountMax 120
Host blinkenshell
HostName ssh.blinkenshell.org
User parrott
@wikitopian
wikitopian / gist:4370497
Last active December 10, 2015 02:48
Programming in Patterns - Example 1.4 - Result
<?php
wp_register_script( 'farbtastic', $this->uri.'/js/lib/farbtastic.js' );
wp_enqueue_script( 'js/lib' );
wp_register_script( 'app', $this->uri.'/js/app.js' );
wp_enqueue_script( 'js' );
wp_register_script( 'panel', $this->uri.'/js/panel.js' );
wp_enqueue_script( 'js' );
@wikitopian
wikitopian / gist:4370413
Created December 24, 2012 19:14
Programming in Patterns - Example 1.1 - Scripts to load
<script type="text/javascript" src="js/lib/farbtastic.js"></script>
<script type="text/javascript" src="js/app.js"></script>
<script type="text/javascript" src="js/panel.js"></script>
<script type="text/javascript" src="js/ui.js"></script>
<script type="text/javascript" src="js/version.js"></script>
<script type="text/javascript" src="kuler/kuler.js"></script>
<script type="text/javascript" src="jqm/1.2.0/panel.js"></script>
@wikitopian
wikitopian / .vimrc
Created August 16, 2012 16:09
Dealing with tabs and spacing in Vim
" The final answer to the Tab Question
set colorcolumn=80
set shiftwidth=4
set tabstop=4
set softtabstop=4
set expandtab
set list listchars=tab:»·,trail:·
function! SwitchTab()
setlocal expandtab!
@wikitopian
wikitopian / search80.vim
Created August 2, 2012 20:33
Search pattern to identify lines over 80 columns
/\(^.\{80}\)\@<=\(.\+\)$
@wikitopian
wikitopian / colorcolumn.vim
Created August 2, 2012 20:21
Use Vim's ColorColumn to help enforce the 80 column rule
set colorcolumn=80
@wikitopian
wikitopian / trim.vim
Created August 2, 2012 15:57
Trim trailing whitespace
:%s/\s\+$//gc