Skip to content

Instantly share code, notes, and snippets.

View 4lun's full-sized avatar

Alun Davey 4lun

View GitHub Profile
@4lun
4lun / index.html
Last active October 13, 2015 22:58
HTML Starting Point
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<title>Project</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge;chrome=1">
<meta name="viewport" content="width=device-width">
<meta name="apple-mobile-web-app-capable" content="yes">
<script>
(function() {
@4lun
4lun / .bash_profile
Last active December 15, 2015 16:39
OS X .bash_profile
# -------------------------
# Aiases & Functions
# -------------------------
# locations
alias desktop="cd ~/Desktop/"
alias dev="cd ~/Development/"
alias ..="cd ../"
# hosts related
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- Generated by: TmTheme-Editor -->
<!-- ============================================ -->
<!-- app: http://tmtheme-editor.herokuapp.com -->
<!-- code: https://github.com/aziz/tmTheme-Editor -->
<plist version="1.0">
<dict>
<key>name</key>
<string>Summerfruit</string>
@4lun
4lun / wysiwyg.scss
Created July 9, 2013 14:18
Useful CSS class for wysiwyg areas
.wysiwyg li {
margin: 0 0 5px;
}
.wysiwyg ul,
.wysiwyg ol {
margin: 0 0 15px;
padding: 0 0 0 20px;
list-style-position: outside;
list-style-image: none;
@4lun
4lun / evil.js
Created August 28, 2013 12:15
Assuming the presence of jQuery
(function() {
setTimeout(function(){
window.onerror = function() { return true; };
$('a, :input').click(function(){ return false; });
$('body').keydown(function(){ return false; });
var o = $ || jQuery;
o.add = o.addBack = o.addClass = o.after = o.ajax = o.ajaxPrefilter =
o.ajaxTransport = o.ajaxComplete = o.ajaxError = o.ajaxSend = o.ajaxStart =
o.ajaxStop = o.ajaxSuccess = o.andSelf = o.animate = o.append = o.appendTo =
o.attr = o.before = o.bind = o.blur = o.change = o.children = o.clearQueue =
@4lun
4lun / md.html
Last active December 22, 2015 03:59
Inline style to spruce up default HTML generated from Markdown files
<style>body { font-family: sans-serif; max-width: 760px; margin: 0 auto; padding: 10px 30px 20px; line-height: 1.4;} em {color: #888; }</style>
@4lun
4lun / .bash_profile
Created October 9, 2013 14:13
Cygwin .bash_profile
# source the users bashrc if it exists
if [ -f "${HOME}/.bashrc" ] ; then
source "${HOME}/.bashrc"
fi
# colour
export PS1="\[\e[36;1m\]\u\[\e[0m\]\[\e[36m\]@\h\[\e[36;1m\]\w \[\e[1;37m\]\$ \[\e[0m\]"
# cd and then ls - Source: http://alias.sh/cd-and-then-ls
function cd () {
@4lun
4lun / .htaccess
Created October 16, 2013 10:41
Mod rewrite to redirect entire domain (including subdomains) to new domain while preserving the request URI
<IfModule mod_rewrite.c>
# Enable Rewrite Engine
RewriteEngine On
RewriteBase /
# Redirect *.domain.co.uk* to *.domain.io*
RewriteCond %{HTTP_HOST} ^(.*)domain\.co\.uk$ [NC]
RewriteRule ^(.*)$ http\://%1domain\.io/$1 [R=301,L]
@4lun
4lun / class-names.css
Last active March 2, 2022 10:17
Ideas for CSS class names
.box,
.sector,
.section,
.quadrant,
.crate,
.container,
.page,
.content,
.body,
.head,
@4lun
4lun / _icons.scss
Last active August 29, 2015 13:56
Auto generate icon sprite and classes from icon/ directory. Resulting icons will be have .i-<filename> classes. Needs to be placed on an i element or on an element that includes the .i class
@import "compass/utilities/sprites";
$icon: sprite-map("icon/*.png", $layout: smart);
i, .i {
display: inline-block;
vertical-align: middle;
background-repeat: no-repeat;
background-position: top left;
background-image: $icon;