Skip to content

Instantly share code, notes, and snippets.

View subhaze's full-sized avatar

Michael Russell subhaze

View GitHub Profile
@subhaze
subhaze / README-Makefiles.md
Last active August 29, 2015 13:57
A collection of no frills Makefiles for JS building, CSS building, and deployments

You can combine all these makefiles into one, or, use a master Makefile that calls these.

For auto building you can use watch or if your editor supports build tools call the makefiles on save.

@subhaze
subhaze / Makefile
Created April 2, 2014 00:27
Quick and to the point Makefile for rsync deploys
deploy:
rsync -a --delete ./ username@hostname:/path/to/web/root
.PHONY: deploy
@subhaze
subhaze / .htaccess
Created June 24, 2014 14:30
No-frills .htaccess file w/Gzip
# BEGIN GZIP
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
# END GZIP
RewriteEngine On
# Some hosts may require you to use the `RewriteBase` directive.
# If you need to use the `RewriteBase` directive, it should be the
@subhaze
subhaze / custom-grid.scss
Last active August 29, 2015 14:06
So... I had to deal with a site that was original based on 16 cols, but, ended up with a few pages that were a mixture of 16 and 12 col layouts...
//Bootstrap 3 grid inception
@mixin new-grid($class, $columns, $grid-gutter-width: $grid-gutter-width){
$i: 1;
$grid-columns: $columns;
@include make-grid-columns($i: 1, $list: ".col-#{$class}-xs-#{$i}, .col-#{$class}-sm-#{$i}, .col-#{$class}-md-#{$i}, .col-#{$class}-lg-#{$i}");
@include make-grid(#{$class}-xs);
@media (min-width: $screen-sm-min) {
@include make-grid(#{$class}-sm);
}
@subhaze
subhaze / .htaccess
Last active August 29, 2015 14:07 — forked from bhollis/.htaccess
AddEncoding gzip .gz
RewriteEngine on
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{HTTP_USER_AGENT} !Konqueror
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule ^(.*)\.css$ $1.css.gz [QSA,L]
RewriteRule ^(.*)\.js$ $1.js.gz [QSA,L]
RewriteRule ^(.*)\.html$ $1.html.gz [QSA,L]
@subhaze
subhaze / _media_mixins_bootstrap.scss
Created May 29, 2015 20:34
mixins to hit specific screen sizes using bootstrap's screen variables
/* Extra small devices (phones, less than 768px) */
/* No media query since this is the default in Bootstrap */
/* Small devices (tablets, 768px and up) */
@media (min-width: $screen-sm-min) { ... }
/* Medium devices (desktops, 992px and up) */
@media (min-width: $screen-md-min) { ... }
/* Large devices (large desktops, 1200px and up) */
@subhaze
subhaze / .gitconfig
Created April 2, 2012 22:42
current gitconfig setup that I've pieced together with personal stuff and things found on teh internets
[color]
# turn on color
diff = auto
status = auto
branch = auto
interactive = auto
ui = auto
[color "branch"]
current = green bold
local = green
@subhaze
subhaze / gist:2910735
Created June 11, 2012 15:41
HTML: HTML5 skeleton
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" media="screen" href="assets/stylesheets/css/master.css" />
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
@subhaze
subhaze / wp_xml_export_mashup.py
Last active November 11, 2015 18:53
I couldn't find any concrete way of selectively pulling content from an old Wordpress blog (with attachments). So... this python script will take an xml export file of all your Wordpress content and only move over the attachments that are found based on your selective content Wordpress export.
import codecs
from bs4 import BeautifulSoup
soup_all = BeautifulSoup(open('Wordpress_all_content.xml'))
soup_all_items = soup_all.find_all('item')
soup_posts = BeautifulSoup(open('Wordpress_selective_content.xml'))
soup_posts_items = soup_posts.channel.find_all('item')
def match_post(item):
@subhaze
subhaze / cause-mootools-is-cool.js
Last active December 19, 2015 12:58
'Cause mootools is cool.
jQuery.moo = {
substitute: function(str, object, regexp){
return String(str).replace(regexp || (/\\?\{([^{}]+)\}/g), function(match, name){
if (match.charAt(0) == '\\') return match.slice(1);
return (object[name] != null) ? object[name] : '';
});
}
};