Skip to content

Instantly share code, notes, and snippets.

mapkey('J', '#3Go one tab left', 'RUNTIME("previousTab")');
mapkey('K', '#3Go one tab right', 'RUNTIME("nextTab")');
@davidmerrique
davidmerrique / gist:4ae194ee62e8413b447e
Created March 29, 2016 02:36
Kirby + DigitalOcean + Apache
Change the apache2 configuration to enable override all
sudo vi /etc/apache2/apache2.conf
Change on <Directory /var/www/>
AllowOverride none
to
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
'use strict';
var gulp = require('gulp');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var uglify = require('gulp-uglify');
var coffeeify = require('coffeeify');
var shim = require('browserify-shim');
@davidmerrique
davidmerrique / keybase.md
Last active August 29, 2015 13:58
keybase.md

Keybase proof

I hereby claim:

  • I am davidmerrique on github.
  • I am davidm (https://keybase.io/davidm) on keybase.
  • I have a public key whose fingerprint is 17DC C478 39F8 BD06 B84F 4D4B EFA9 B4DD C13C 3205

To claim this, I am signing this object:

@davidmerrique
davidmerrique / gist:7913493
Created December 11, 2013 16:20
Clean Desktop - Just moves files into a Desktop folder in Documents.
shopt -s nullglob
date="$(date "+%Y-%m-%d")"
folderTime="$(date "+%H%M%S")"
dest="/Users/$USER/Documents/Desktop/$date"
src=(/Users/$USER/Desktop/*)
files="/Users/$USER/Desktop/*"
if [ ${#src[@]} -gt 0 ]; then
@davidmerrique
davidmerrique / gist:5707722
Created June 4, 2013 17:10
Centered fixed-width elements packery.
// http://packery.metafizzy.co/packery.pkgd.js added as external resource
docReady( function() {
var container = document.querySelector('.packery');
var pckry = new Packery( container, {
itemSelector: '.item',
columnWidth: 150,
gutter: 20,
// disable resize
isResizeBound: false
@davidmerrique
davidmerrique / slate.js
Created April 10, 2013 04:24
My Slate config. Allows for margins between windows and screen edges.
var margin = 15;
S.cfga({
"defaultToCurrentScreen" : true,
"secondsBetweenRepeat" : 0.1,
"checkDefaultsOnLoad" : true,
"focusCheckWidthMax" : 3000
});
// Create Operations
@davidmerrique
davidmerrique / gist:4363870
Created December 23, 2012 15:10
Apply-to media query.
// Custom media Query
// Use: If you want to a media query to apply to anything less-than or greater-than a specific width.
// Example:
// @include apply-to(less-than, 1200px) {}
// Will apply to anything smaller than 1200px
@mixin apply-to($maxmin, $size) {
$extrema: null;
@if $maxmin == less-than {
$extrema: max;
} @if $maxmin == greater-than {
@davidmerrique
davidmerrique / zoomify.jsx
Last active April 14, 2017 06:17
Photoshop Script to save multiple sizes of an image. I use it for work.
var inFolder = Folder.selectDialog("Please select folder to process");
if(inFolder !== null) {
var fileList = inFolder.getFiles(/\.(jpg|tif|psd|)$/i);
var outfolderName = prompt('Folder name', 'zoom');
var outfolder = new Folder(decodeURI(inFolder) + "/" + outfolderName);
if (!outfolder.exists) outfolder.create();
for(var a = 0; a < fileList.length; a++) {