Skip to content

Instantly share code, notes, and snippets.

View thathurtabit's full-sized avatar

Stephen Fairbanks thathurtabit

View GitHub Profile
@thathurtabit
thathurtabit / Gruntfile.js for LESS only
Created February 6, 2014 12:02
Gruntfile.js for LESS only
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
}
},
@thathurtabit
thathurtabit / Gruntfile.js
Last active August 29, 2015 14:02
Bootstrap LESS setup with Bower Structure
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
//Read the package.json (optional)
pkg: grunt.file.readJSON('package.json'),
// Metadata.
meta: {
@thathurtabit
thathurtabit / gist:18999c85dc52fd94b798
Created August 13, 2014 16:29
Grunt Bower Bootstrap
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
//Read the package.json (optional)
pkg: grunt.file.readJSON('package.json'),
// Metadata.
meta: {
@thathurtabit
thathurtabit / index.html
Created March 22, 2013 13:35
A CodePen by Stephen Fairbanks. Super Simple Progress Bar - This progress bar uses the HTML5 custom data-* attribute to allow for quick updating to a progress bar animated by Zepto (or jQuery). The animation is wrapped in a window.resize function to reanimate if the browser size is changed.
<div class="progress-wrap progress" data-progress-percent="22">
<div class="progress-bar progress"></div>
</div>
@thathurtabit
thathurtabit / index.html
Created March 22, 2013 19:26
A CodePen by Stephen Fairbanks. Super Simple Progress Bar - This progress bar uses the HTML5 custom data-* attribute to allow for quick updating to a progress bar animated by Zepto (or jQuery). The animation is wrapped in a window.resize function to reanimate if the browser size is changed.
<div class="progress-wrap progress" data-progress-percent="25">
<div class="progress-bar progress"></div>
</div>
@thathurtabit
thathurtabit / index.html
Created March 22, 2013 19:39
A CodePen by Stephen Fairbanks. Super Simple Progress Bar - This progress bar uses the HTML5 custom data-* attribute to allow for quick updating to a progress bar animated by Zepto (or jQuery). The animation is wrapped in a window.resize function to reanimate if the browser size is changed.
<!-- Change the below data attribute to play -->
<div class="progress-wrap progress" data-progress-percent="25">
<div class="progress-bar progress"></div>
</div>
@thathurtabit
thathurtabit / Gruntfile.js
Last active December 17, 2015 23:59
My basic Gruntfile.js - used to copy files form development to deploy, set-up sass/compass, uglify js, jshint, compress css and watch all files / folders.
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
//Read the package.json (optional)
pkg: grunt.file.readJSON('package.json'),
// Metadata.
meta: {
@thathurtabit
thathurtabit / Gruntfile.js LESS
Last active December 19, 2015 02:29
Gruntfile.js for a small LESS-based project
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
//Read the package.json (optional)
pkg: grunt.file.readJSON('package.json'),
// Metadata.
meta: {
{
"git.autofetch": true,
"editor.fontFamily": "Fira Code",
"editor.fontSize": 13,
"editor.fontLigatures": true,
"workbench.iconTheme": "vscode-icons",
"files.exclude": {
"**/node_modules": true,
"**/gems": true,
"**/._*": true,
@thathurtabit
thathurtabit / truncateText.js
Last active September 25, 2019 12:58
Truncate Text
export const truncateText = (text, characterLimit, addEllipsis = true) => {
if (text.length <= characterLimit) {
return text
} else {
const specialChars = ['.',',','!','?','-','—',' ']
let truncatedText = text.substring(0, characterLimit)
if (addEllipsis) {
const lastTruncatedChar = () => truncatedText.charAt(truncatedText.length - 1)
const hasSpecialLastChar = () => specialChars.includes(lastTruncatedChar())