Skip to content

Instantly share code, notes, and snippets.

View mikeclagg's full-sized avatar

Mike Clagg mikeclagg

View GitHub Profile
@mikeclagg
mikeclagg / getCssFiles.py
Created November 21, 2012 00:22
Read a css file that contains @import directives, follows those to build a list of files to concatenate for web optimization
def getCssFiles(baseCssFile, css_files):
import os, re
"""
Checks for css files that are just @import containers,
traverses the files and builds a list in the order they
appear in the files. This prepares a list to use for
bundling n webassets
"""
with open(baseCssFile, 'r') as f:
# Check to see if baseCssFile contains an @import statement at the top
@vojtajina
vojtajina / all-templates.html
Created August 15, 2012 00:00
AngularJS: load all templates in one file
<script type="text/ng-template" id="one.html">
<div>This is first template</div>
</script>
<script type="text/ng-template" id="two.html">
<div>This is second template</div>
</script>
@twhid
twhid / gist:2648062
Created May 9, 2012 19:05
grunt task to deploy JS files to S3 with awssum
grunt.registerMultiTask('s3deploy', 'deploy to S3 using awssum', function () {
// dependencies
var awssum = require('awssum'),
fs = require('fs'),
path = require('path'),
aws = require('./settings').aws;
var amz = awssum.load('amazon/amazon'),
AmazonS3 = awssum.load('amazon/s3'),
s3 = new AmazonS3(aws.accessKey, aws.secretKey, aws.accountId , amz.US_EAST_1),
@michiel
michiel / cors-nginx.conf
Created July 5, 2011 10:41
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#