This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(!Modernizr.input.placeholder){ | |
$('input[placeholder], textarea[placeholder]').each(function() { | |
$(this).val($(this).attr('placeholder')); | |
$(this).addClass('is-placeholder'); | |
}).blur(function() { | |
if ($(this).val() === '') { | |
$(this).val($(this).attr('placeholder')); | |
$(this).addClass('is-placeholder'); | |
} | |
}).focus(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Smooth font */ | |
.smooth-font { | |
transform: rotate(-0.0000000001deg); | |
} | |
/* Center an element vertically + horizontally */ | |
.center { | |
position: absolute; | |
top: 0; | |
right: 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('body').bind('click', function() { $('body,html').stop().animate({ scrollTop: $('body').scrollTop() + $('body').height() }, 1000); }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
grunt.initConfig({ | |
shell: { | |
exportIcons: { | |
command: 'sketchtool export slices assets/icons.sketch --output=assets/icons/' | |
} | |
}, | |
webfont: { | |
icons: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(d,s){s=d.createElement('style');s.innerHTML='::-webkit-scrollbar{display:none}';d.head.appendChild(s)})(document) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extends the Layer class with a new function that returns the first nested | |
# sublayer from the provided path of names. | |
# e.g., innerCircle = screenLayer.sublayerByPath('Box/Inner_Box/Inner_Circle') | |
Layer.prototype.subLayerByPath = (path = '', delimeter = '/') -> | |
names = path.split(delimeter) | |
layers = this.subLayersByName(names.shift() || '') | |
if (layers.length && names.length) | |
path = names.join(delimeter) | |
return layers[0].subLayerByPath(path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var exec = require('child_process').exec; | |
gulp.task('default', function (cb) { | |
exec('sketchtool export slices assets/icons.sketch --output=assets/icons/', function (err, stdout, stderr) { | |
console.log(stdout); | |
console.log(stderr); | |
cb(err); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Changing metadata ----------------------------------------------------------- | |
# Copy tags from one file to another | |
# http://thomer.com/howtos/copy_exif.html | |
exiftool -TagsFromFile a.jpg b.jpg | |
# Photos — change CreateDate metadata | |
exiftool "-CreateDate=2017:05:17 12:00:00" IMG.jpg | |
# Videos — change date to "Creation Date" (written by DSLRs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Crop to 1240x768 (tablet) on retina screen | |
ffmpeg -i input.mp4 -filter:v "crop=2048:1536:256:32" output.mp4 | |
# Center video onto 1920x1080 canvas with white background | |
ffmpeg -i input.mov -vf "scale=min(iw*1080/ih\,1920):min(1080\,ih*1920/iw),pad=1920:1080:(1920-iw)/2:(1080-ih)/2:color=white" output.mov |