Skip to content

Instantly share code, notes, and snippets.

Avatar

Alun Davey 4lun

View GitHub Profile
@4lun
4lun / index.html
Last active Oct 13, 2015
HTML Starting Point
View index.html
<!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 Dec 15, 2015
OS X .bash_profile
View .bash_profile
# -------------------------
# Aiases & Functions
# -------------------------
# locations
alias desktop="cd ~/Desktop/"
alias dev="cd ~/Development/"
alias ..="cd ../"
# hosts related
View Summerfruit TWEAKED.tmTheme
<?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 Jul 9, 2013
Useful CSS class for wysiwyg areas
View wysiwyg.scss
.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 Aug 28, 2013
Assuming the presence of jQuery
View evil.js
(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 Dec 22, 2015
Inline style to spruce up default HTML generated from Markdown files
View md.html
<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 Oct 9, 2013
Cygwin .bash_profile
View .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 Oct 16, 2013
Mod rewrite to redirect entire domain (including subdomains) to new domain while preserving the request URI
View .htaccess
<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 Nov 17, 2019
Ideas for CSS class names
View class-names.css
.box,
.sector,
.section,
.quadrant,
.crate,
.container,
.page,
.content,
.body,
.head,
@4lun
4lun / _icons.scss
Last active Aug 29, 2015
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
View _icons.scss
@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;
You can’t perform that action at this time.