Skip to content

Instantly share code, notes, and snippets.

@andershaig
andershaig / boxes.css
Created December 20, 2011 19:42
CSS3 Box Styles
.all_boxes {
display:block;
height:125px;
margin:0 0 50px;
}
.all_boxes h3 {
text-align:center;
line-height:125px;
color:#222;
@andershaig
andershaig / make_thumbs.js
Created December 20, 2011 22:26
Image Thumbnails using JavaScript
// Example: all images with a class of .img get sized to 150px.
makeThumbs({
selector: '.img',
size: 150
});
function makeThumbs() {
var selector = args.selector;
var thumb_size = args.size;
@andershaig
andershaig / dabblet.css
Created December 22, 2011 01:13
Image Thumbnail w/ Bevel
/**
* Image Thumbnail w/ Bevel
*/
#bevel {
width:384px;
height:284px;
border:8px solid;
border-color:rgba(213,213,213,0.35) rgba(75,75,75,0.35) rgba(48,48,48,0.35) rgba(202,202,202,0.35);
-webkit-box-shadow:inset 1px 1px 0 0 rgba(255,255,255,0.35), inset -1px -1px 0 0 rgba(255,255,255,0.20);
@andershaig
andershaig / fan_check.js
Created February 1, 2012 18:43
Request Fan Status
window.checkDoesLike = function() {
FB.api({ method: 'pages.isFan', page_id: '184484190795' }, function(resp) {
if (resp) {
Log.info('You like the Application.');
} else {
Log.error("You don't like the Application.");
}
});
};
@andershaig
andershaig / dabblet.css
Created February 21, 2012 21:08
Alert Styles
/**
* Alert Styles
*/
.alert {
padding: 7px 14px;
margin-bottom: 5px;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
background-color: #FCF8E3;
border: 1px solid #FBEED5;
@andershaig
andershaig / hex.html
Created February 26, 2012 13:57
Hex Color from CSS Output
<div id="color"></div>
<script type="text/javascript">
var css_color = '{% style color my_color %}';
var re = /#?([a-f]|[A-F]|[0-9]){3}(([a-f]|[A-F]|[0-9]){3})?\b/ig;
var hex = re.exec(css_color);
// Print the hex to our div so we can see it working
$('#color').html(hex[0]);
@andershaig
andershaig / debug.css
Created February 28, 2012 01:33
View CSS Structure
* { outline: 2px dotted red }
* * { outline: 2px dotted green }
* * * { outline: 2px dotted orange }
* * * * { outline: 2px dotted blue }
* * * * * { outline: 1px solid red }
* * * * * * { outline: 1px solid green }
* * * * * * * { outline: 1px solid orange }
* * * * * * * * { outline: 1px solid blue }
@andershaig
andershaig / xml.js
Created February 28, 2012 01:50
XML Generator
function xmlgen(name, data) {
var xml;
if (!data) {
xml = '<' + name + '/>';
} else {
xml = '<'+ name + '>' + data + '</' + name + '>';
}
return xml;
@andershaig
andershaig / widget.js
Last active October 1, 2015 07:08
Widget Refresh Completed
$(document).on('didRefreshWidgetContent', function () {
// Do something
});
@andershaig
andershaig / CSS3_Full.jsx
Created April 17, 2012 21:44
Create CSS3 code from Photoshop layers
/* Copyright 2012 - Minim Group - http://minim.co/ */
// Enable double-clicking from Finder/Explorer
#target photoshop
app.bringToFront();
// ### Document Variables
var doc_layers = app.activeDocument.layers;
var num_layers = doc_layers.length;