Skip to content

Instantly share code, notes, and snippets.

View jobsturm's full-sized avatar
💫

Job Sturm jobsturm

💫
View GitHub Profile
@jobsturm
jobsturm / gulpfile.js
Created January 22, 2016 15:47
A Gulpfile that minifies, concats and uglifies like nobodies business. Contains BrowserSync as a local webserver when using the gulp serve task. The default task assumes you are working on the server but would still like to use BrowserSync for livereload functionality. Also includes Angular specific functions such as safe uglifying and copying o…
var _PREFIX = '';
var _SHORTNAME = '<your-project-shortname>';
var _BASE = '';
var _SOURCE = _BASE+'dev/';
var _TARGET = _BASE+'static/';
var _API_PLACEHOLDER = '$API_URL'; // String in your JS files that gets replaced with the correct API url
var _DEV_API_URL = '<path-to-where-your-dev-api-lives>';
var _ACC_API_URL = '<path-to-where-your-acceptation-api-lives>';
var _PROD_API_URL = '<path-to-where-your-production-api-lives>';
var _HEADER = [
@jobsturm
jobsturm / gulpfile.js
Created January 22, 2016 15:47
Gulp File for Default Projects. Uses BrowserSync for live-reload, variables so you can define your own base and dist folders easily, and includes tasks such as the Spritesheet task which will make one spritesheet *and* makes SCSS mixins for you (including retina sprites). If you're building an Angular app, don't forget to add gulp-ngAnnotate (se…
var _PREFIX = '';
var _SHORTNAME = '<your-project-shortname>';
var _BASE = '';
var _SOURCE = _BASE+'build/';
var _TARGET = _BASE+'app/includes/';
var _HEADER = [
'/*',
'',
' Your Project Name',
' v1.0',
@jobsturm
jobsturm / gulpfile.js
Created January 22, 2016 15:47
Gulp for Mura Workflows
//requirements
'use strict';
// IF YOU USE $ASSETPATH IN YOUR JS FILES, IT WILL GET REPLACED BY GULP TO A VALUE YOU SET HERE.
var _ASSETPATH = '$ASSETPATH';
var _LOCAL_ASSETPATH = 'assets'
var _MURA_ASSETPATH = '/plugins/banning/includes/assets'
// GULP DEFAULTS
var gulp = require('gulp');
@jobsturm
jobsturm / Awesome mixins
Created January 22, 2016 15:47
Awesome Mixins
// CONVERT HEX COLOR TO RGBA
@mixin rgba-color($t,$c,$o:1){
$rgba: rgba($c,$o);
#{$t}: #{$rgba};
}
@jobsturm
jobsturm / sassmixins.sass
Created January 22, 2016 15:47
SASS Mixins.
@mixin keyframes($animation-name)
@-webkit-keyframes $animation-name
@content;
@-moz-keyframes $animation-name
@content;
@-ms-keyframes $animation-name
@content;
@jobsturm
jobsturm / gradient.scss
Created January 22, 2016 15:47
SCSS gradient.
/// Convert angle
/// @param {Number} $value - Value to convert
/// @param {String} $unit - Unit to convert to
/// @return {Number} Converted angle
@function convert-angle($value, $unit) {
$convertable-units: deg grad turn rad;
$conversion-factors: 1 (10grad/9deg) (1turn/360deg) (3.1415926rad/180deg);
@if index($convertable-units, unit($value)) and index($convertable-units, $unit) {
@return $value
/ nth($conversion-factors, index($convertable-units, unit($value)))
@jobsturm
jobsturm / celobos.js
Created January 22, 2016 15:46
I made this scrip because I've been noticing designers making the designs in which elements move position when the site changes size. For example: :: Desktop - elem 1 - elem 2 :: Mobile - elem 2 - elem 1 This script should make bringing those designs to life a lot easier. (C)hange (e)lement (lo)cation (b)ased (o)n (s)ize, celobos.js for short. (…
/*jslint browser: true*/
/*global $*/
/*
// NEEDS JQUERY
This script will move elements in the code to other elements based on the size of the screen.
You define what it has to move in the html using data attributes.
Those attributes are:
@jobsturm
jobsturm / maths.scss
Created January 22, 2016 15:46
These two scripts combined create CSS only triangles.
@function pow($number, $exp) {
$value: 1;
@if $exp > 0 {
@for $i from 1 through $exp {
$value: $value * $number;
}
}
@else if $exp < 0 {
@for $i from 1 through -$exp {
$value: $value / $number;
@jobsturm
jobsturm / 0_reuse_code.js
Last active August 29, 2015 14:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console