Skip to content

Instantly share code, notes, and snippets.

View tlinkner's full-sized avatar

tlinkner tlinkner

  • TLDA
  • Providence, RI
View GitHub Profile
/* Debug: Tell Size
===========================================================
Show browser size. Turn off on production.
*/
(function () {
var ts = document.createElement('div');
ts.setAttribute("id", "msg");
ts.style.cssText = "padding:0.25em;position:fixed;bottom:0;right:0;font-size:0.75em;font-weight:bold;color:white;background:red;";
document.body.appendChild(ts);
@tlinkner
tlinkner / BalanceDiagonal.jsx
Created January 11, 2017 20:52
This script is for Illustrator CC. It resizes objects to have the same diagonal dimension.
// BalanceDiagonal.jsx
// 2017 Todd Linkner
// License: none (public domain)
// v1.0
//
// This script is for Illustrator CC. It resizes objects to have the same diagonal dimension.
//
// Install to /Applications/Adobe Illustrator CC/en_US/Scripts/Mobile
// bring Illustrator into focus
# Install
brew install zint
# EAN
zint --directeps --height="30" --barcode="13" --data="123456789104" > 1234-ean.eps
# UPC
zint --directeps --height="30" --barcode="34" --data="12345678910" > 1234-upc.eps
# Help
# Rename files
### brew install rename
### Dry run
rename -nvs searchword replaceword *
### Rename
rename -vs searchword replaceword *
### Node renamer
@tlinkner
tlinkner / Gruntfile.js
Created February 23, 2016 02:14
Drupal 8 Grunt Livereload
module.exports = function (grunt) {
"use strict";
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
prod: {
options: {
outputStyle: 'compressed'
},
files: {
@tlinkner
tlinkner / Gruntfile.js
Last active February 16, 2018 17:50
Grunt LiveReload with SASS and Local Server
module.exports = function (grunt){
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Watches for changes in the the specified files and run the task
watch : {
refresh : {
options :{
livereload: '<%= connect.options.livereload %>'
},
files: ['www/**/*.js','www/**/*.scss','www/**/*.css','www/**/*.html'],
@tlinkner
tlinkner / gist:edff88799a0cee42e4b6
Created May 13, 2015 19:29
Pandoc MS Word to Markdown
pandoc input-file.docx -t markdown -o output-file.md
@tlinkner
tlinkner / simpleServer.bash
Created April 2, 2015 19:14
Bash function to runa simple local server
server () {
python -m SimpleHTTPServer &
open http://0.0.0.0:8000
}
@tlinkner
tlinkner / aspect-wrapper.css
Created April 2, 2015 13:38
Fluid element that maintains a specific aspect ratio
/*
Fluid element that maintains a specific aspect ratio
====================================================
<div class="aspect-wrapper">
<div class="inner">
<img src="image.jpg" alt="Image">
</div>
</div>
*/
@tlinkner
tlinkner / tellsize.js
Last active October 12, 2015 16:18
Show browser dimensions
/* Debug: Tell Size
===========================================================
Show browser size. Turn off on production.
*/
(function () {
var ts = document.createElement('div');
ts.setAttribute("id", "msg");
ts.style.cssText = "padding:0.25em;position:fixed;bottom:0;right:0;font-size:0.75em;font-weight:bold;color:white;background:red;";
document.body.appendChild(ts);