Skip to content

Instantly share code, notes, and snippets.

@ben-w-smith
ben-w-smith / gulp task
Last active November 18, 2015 18:00
Live Reload Gist
var path = {
watch: [
'file(s) you want to watch'
// example: '**/*.html'
]
};
// Include gulp
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')();
# Credits go to:
# https://gist.github.com/kconragan/2510186
defaults write com.sublimetext.3 ApplePressAndHoldEnabled -bool false
# Note: replace com.sublimetext.3 with whichever version of Sublime Text you are running
# eg. 'com.sublimetext.2'
# Alternately, if you want this feature disabled globally, you can enter this:
@ben-w-smith
ben-w-smith / font-responsive-mixin.scss
Last active October 31, 2022 11:48
Responsive Font SASS mixin
// SASS mixin duplicating rucksack's cool cool solution on creating responsive font sizes.
//
// The calculation is:
// min-size + (min-size - max-size) * ( (100vw - min-width) / ( max-width - min-width) )
//
@mixin font-responsive($fmin, $fdiff, $breakmin, $breakdiff) {
font-size: calc( #{$fmin} + #{$fdiff} * ((100vw - #{$breakmin}) / #{$breakdiff}) );
@media(max-width: $breakmin) {
font-size: $fmin;
}
@ben-w-smith
ben-w-smith / gulpfile.js
Created February 26, 2016 18:34
Gulp with BrowserSync with ngrok
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var ngrok = require('ngrok');
gulp.task('default', function() {
browserSync.init({
server: {
baseDir: "./public"
}
var res = {
'status': 'error',
'message': 'No use case for what went wrong'
};
if( !("username" in request.params) ) {
res.message = "No username provided";
}
if( !("password" in request.params) ) {