Skip to content

Instantly share code, notes, and snippets.

@adamcoulombe
adamcoulombe / index.html
Created August 14, 2016 12:28
Blank index.html
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
@adamcoulombe
adamcoulombe / updateAllLinkedSmartObjectsInFolder.jsx
Created February 27, 2015 20:34
Photoshop Script: Update all Linked Smart Objects in a Folder of PSD files
var folderPath = "/c/Users/Adam/Projects/myproject"
//var inputFolder = Folder.selectDialog ("Select the folder that contains the files for export:");
var inputFolder = Folder(folderPath);
var files = inputFolder.getFiles (/\.(psd)$/i);
for (var i = 0; i < files.length; i++) {
var f = files[i];
var doc = app.open (f);
@adamcoulombe
adamcoulombe / Gruntfile.js
Created January 31, 2015 05:58
generate pngs from all psds in a folder with grunt
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
'convertPSD': {
target: { prop1:1 },
var stylesheets = document.styleSheets;
for (i in stylesheets) {
var stylesheet = stylesheets[i];
var rules = stylesheet.cssRules;
for (j in rules) {
var rule = rules[j];
if (rule instanceof CSSFontFaceRule) {
var src = rule.style.getPropertyValue('src');
var srcSansLocal = src.replace(/local\([^\)]+?\)\s*,\s*/i, '');
rule.style.setProperty('src', srcSansLocal, null);
function ExpandSelect(select, maxOptionsVisible)
{
//
// ExpandSelect 1.00
// Copyright (c) Czarek Tomczak. All rights reserved.
//
// License:
// New BSD License (free for any use, read more at http://www.opensource.org/licenses/bsd-license.php)
//
// Project's website:
var isiPhone = (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i));
var getWindowHeight = function(){
// this was the most reliable way I could find of getting the actual viewport height without the status, address or button bar.
return isiPhone ? window.screen.availHeight - (window.navigator.standalone ? 0 : 44) : $(window).height();
}
//Lose the address bar
@adamcoulombe
adamcoulombe / animationEnd.js
Created March 4, 2013 21:10
animationEnd event
var animationEnd="animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd"
/*!
* jQuery JavaScript Library v2.0.0pre
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
@mixin png-image-set($image){
@include image-set($image, "png");
}
@mixin jpg-image-set($image){
@include image-set($image, "jpg");
}
@mixin gif-image-set($image){
@include image-set($image, "gif");
}
@mixin image-set($name,$extension){
@adamcoulombe
adamcoulombe / myxml.xml
Created April 21, 2012 01:44
Reading and Saving XML files with PHP DOMDocument
<?xml version="1.0" encoding="utf-8"?>
<root>
<color type="white"/>
</root>