Skip to content

Instantly share code, notes, and snippets.

View haydenbleasel's full-sized avatar
🔮
Working on Eververse

Hayden Bleasel haydenbleasel

🔮
Working on Eververse
View GitHub Profile
@haydenbleasel
haydenbleasel / gulpfile.js
Created April 18, 2016 06:08
Catalyst: task automation boilerplate for experienced web developers
const gulp = require('gulp'),
sync = require('browser-sync').create(),
del = require('del'),
minimist = require('minimist')(process.argv.slice(2)),
$ = require('gulp-load-plugins')(),
info = require('./package.json'),
header = '/*! Built with Catalyst. */',
staticFiles = gulp.src([
'test/source/**/*',
'!test/source/**/*.html',
@haydenbleasel
haydenbleasel / .editorconfig
Last active March 5, 2016 15:28
My default configuration files.
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@haydenbleasel
haydenbleasel / jquery-soundcloud.js
Last active November 18, 2015 05:24
jQuery setup for the SoundCloud API
$ ->
# Create abc,def string
Number::numberWithCommas =
String::numberWithCommas = ->
@toString().replace /\B(?=(\d{3})+(?!\d))/g, ','
# Initial sound is empty
sound = undefined
@haydenbleasel
haydenbleasel / gist-flat-dark.less
Last active December 26, 2022 19:14
A collection of GitHub Gist styles and themes.
.gist {
.gist-file {
border: none !important;
margin-bottom: 0 !important;
.gist-data {
border-bottom: 2px solid #7f8c8d !important;
.line-numbers {
border-right: 2px solid #7f8c8d !important;
padding: 1em !important;
}
@haydenbleasel
haydenbleasel / sanitize.js
Created March 18, 2014 06:50
Javascript filename sanitization
// Sanitize a filename. Try 'df.34.%)sdfE$t5.HF.mp4'
var extension = fileName.split('.').slice(0).pop(),
sanitized = filename.replace(extension, '').replace(/\W+/g, '') + "." + extension;
@haydenbleasel
haydenbleasel / transfade.js
Last active July 14, 2019 10:23
Medium-style vertical fading parallax scroll modifier for Stellar.js
// Custom transform and opacity modifier for Stellar.js
$.stellar.positionProperty.transfade = {
setPosition: function(element, newLeft, originalLeft, newTop, originalTop) {
var distance = newTop - originalTop;
var rate = $(window).height() / 5;
element.css('transform', 'translate3d(0, ' + distance + 'px, 0').css('opacity', 1 - (distance / rate));
}
};