Skip to content

Instantly share code, notes, and snippets.

View kalepail's full-sized avatar
🦐
Work, and stuff will happen.

Tyler van der Hoeven kalepail

🦐
Work, and stuff will happen.
View GitHub Profile
@kalepail
kalepail / gulpfile.js
Last active December 14, 2015 21:08
Rename files with Gulp
var gulp = require("gulp");
var rename = require("gulp-rename");
gulp.task('default', function() {
return gulp.src("./*.md")
.pipe(rename(function(path) {
path.basename = path.basename.replace(/(\D*\d{4}-\D*\d{2}-\D*\d{2})(-)/, "$1.");
}))
.pipe(gulp.dest("./renamed"));
});
var gulp = require('gulp'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
imagemin = require('gulp-imagemin'),
livereload = require('gulp-livereload'),
phpServer = require('php-built-in-server'),
scsslint = require('gulp-scsslint'),
@kalepail
kalepail / SassMeister-input.scss
Created January 6, 2015 18:59
Generated by SassMeister.com.
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
$purple: #7049A3;
// Turn rgba values to rgb values
@function rgba2rgb($color, $bg : 255) {
$a: alpha($color);
@kalepail
kalepail / natural.js
Last active August 29, 2015 14:08
Get an image's natural width and height
(function($){ var props = ['Width', 'Height'], prop;
while (prop = props.pop()) {
(function (natural, prop) {
$.fn[natural] = (natural in new Image()) ?
function () {
return this[0][natural];
} :
function () {
var
node = this[0],
@kalepail
kalepail / app.js
Created April 12, 2014 16:30
Return first image url from a string of content
var rex = /<img[^>]+src="?([^"\s]+)"?[^>]*\/>/g;
for (var i = 0; i < count; i++) {
var content = obj[i].content,
img = content.match(rex);
var results = rex.exec(content);
if (results != null) {
var source = results[1];
@kalepail
kalepail / entry
Last active August 29, 2015 13:59
Statamic Feed for iTunes
---
podcast: /assets/podcasts/short.mp3
title: Finding Creative Inspiration
tags:
- rad
- new
- awesome
---
Today we discuss the importance of the global economy in our desktop jobs. How Squidword may just be onto something and why its important to always wear a towel around your head when entering and exiting public rest areas.