Skip to content

Instantly share code, notes, and snippets.

@krusynth
krusynth / style.less
Created March 28, 2012 01:45
CSS Responsive Framework Less
/*
NOTE: There's some magic going on in .cols() to add a negative right margin.
This resolves the the inline-block issue for uncompressed html. However,
it shouldn't be here - you should minify your html instead. This will
be removed in the immediate future.
This is the core framework for the site.
It implements the baseline LESS CSS Mixins and general style rules.
@krusynth
krusynth / gist:2782431
Created May 24, 2012 16:04
S3 Uploader for Django
# ########################################################
# s3filefield.py
# Extended FileField and ImageField for use with Django and Boto.
#
# Required settings:
# AWS_BUCKET_NAME - String, represents the default bucket name to use if one isn't provided
# AWS_ACCESS_KEY - String
# AWS_SECRET_KEY - String
#
# From here: http://djangosnippets.org/snippets/1976/
@krusynth
krusynth / gallery-core
Created May 29, 2012 11:59
Drag and Drop uploader and sorter. A-mazing.
@krusynth
krusynth / comcast.stylish
Created June 8, 2012 01:25
Chrome Stylish theme to fix Comcast's awful tv listings
#nav .nav_main {
margin-top: 0px;
width: auto;
}
#nav .nav_main li {
font-size: inherit;
}
#nav .nav_main li a {
@krusynth
krusynth / UploadHandler.js
Created June 10, 2012 19:12
Drag and Drop uploader javascript class. Nice and condensed.
/* UploadHandler.js
REQUIRES: jQuery
USAGE:
new UploadHandler(DivName, ArgsHash);
new UploadHandler('#my_div_to_watch', { 'upload_url': '/gallery/post/', 'debug': true });
new UploadHandler(['#div1', '#div2'], { 'upload_url': '/gallery/post/' });
@krusynth
krusynth / bettergradient.less
Created June 21, 2012 13:07
Better Gradient for LESS CSS
/*
Better Gradient
Better gradient LESS CSS mixin. Lets you start and
stop gradients at arbitrary distances, rather than 100%.
This expands on what is done by lesselements
(which is an awesome package!)
http://lesselements.com
@krusynth
krusynth / typography.less
Created June 21, 2012 21:44
LESS CSS makes typography sooo much easier.
/******************* TYPOGRAPHY *******************/
/* Variables & Mixins */
/* Fonts & weights */
@font-stack-main: "franklin-gothic-urw-cond", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
@font-weight-book: 400;
@font-weight-medium: 500;
@font-weight-demi: 700;
@krusynth
krusynth / gmaps_api_hax.html
Created July 3, 2012 15:49
Google Maps API Markers adding custom data to clicks, also Marker Clustering for large numbers of marker pins
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map_canvas { height: 100% }
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
@krusynth
krusynth / cr2tojpeg
Created August 16, 2012 17:19
Convert CR2 files to JPEGs and resize and greyscale
for i in *.CR2; do dcraw -c -a -w -v $i | convert - -resize '1000x1000' -colorspace gray $i.jpg; done;
@krusynth
krusynth / featuredposts.php
Created September 2, 2012 18:08
Wordpress: Featured posts to frontpage
<ul class="gallery-list">
<?php /* Featured galleries */
$parent_id = $post->ID;
$featured_args = array(
'post_type' => 'page',
'meta_key' => 'featured',
'meta_value' => 1,