Skip to content

Instantly share code, notes, and snippets.

View KingScooty's full-sized avatar
🚀

Scotty Vernon KingScooty

🚀
View GitHub Profile
@KingScooty
KingScooty / README.md
Last active January 31, 2018 17:00 — forked from chelsea/README.md
Random Aww

Description

Dashing widget to display a random cute picture from http://reddit.com/r/aww

The display of the widget is heavily based on the Image widget, however it does not prepend the src with 'assets' which allows for external images.

Settings

You can set a placeholder image in the event that reddit is down, or otherwise unresponse. This is set at the top of random_aww.rb as follows:

var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var sass_development = function sass_development() {
var task = gulp
.src([
@KingScooty
KingScooty / gulpfile.js
Last active July 29, 2022 13:54
Linting Sass stylesheets with Stylelint
/**
* Linting Sass stylesheets with Stylelint
* http://www.creativenightly.com/2016/02/How-to-lint-your-css-with-stylelint/
*/
var gulp = require('gulp');
var postcss = require('gulp-postcss');
var reporter = require('postcss-reporter');
var syntax_scss = require('postcss-scss');
@KingScooty
KingScooty / gulpfile.js
Last active February 15, 2016 10:50
Linting CSS stylesheets with Stylelint
/**
* Linting CSS stylesheets with Stylelint
* http://www.creativenightly.com/2016/02/How-to-lint-your-css-with-stylelint/
*/
var gulp = require('gulp');
var postcss = require('gulp-postcss');
var reporter = require('postcss-reporter');
var stylelint = require('stylelint');
@KingScooty
KingScooty / jsonChart.js
Last active November 26, 2015 10:13
Periodically load JSON after initial load and update a chart.
var updateChart = function updateChart () {
$.getJSON( "URL.json", function( data ) {
// callback for event to take place after JSON has been retrieved.
// data is the object containing the JSON.
});
};
var init = function init () {
updateChart();
};
@KingScooty
KingScooty / .bower-postinstall.sh
Last active December 5, 2016 22:17
Using Bower install hooks to prep CSS files for SASS workflows
#!/bin/bash
# Normalize.css - Rename .css file to .scss
mv bower_components/normalize.css/normalize.css bower_components/normalize.css/_normalize.scss
# *Insert other commands below*
@KingScooty
KingScooty / typekit.js
Created February 16, 2015 10:34
Remove Typekit from mobile devices all together.
<script>
//Replace this with your desktop Typekit code
var kit = 'xxxxx'
// Adjust the width threshold
if( window.innerWidth > 800 ) {
document.write('\x3Cscript src="//use.typekit.net/'+ kit +'.js">\x3C/script>');
document.write('\x3Cscript>try{Typekit.load();}catch(e){}\x3C/script>');
};
</script>
@KingScooty
KingScooty / typekit.js
Created February 3, 2015 11:32
Make Typekit non-blocking for smaller screens
<script>
//Replace this with your mobile Typekit code
var kit = 'xxxxx';
// Adjust the width threshold
if( window.innerWidth < 800 ) {
document.write('\x3Cscript src="//use.typekit.net/'+ kit +'.js" onload="try{Typekit.load();}catch(e){}" async>\x3C/script>');
} else {
document.write('\x3Cscript src="//use.typekit.net/'+ kit +'.js">\x3C/script>');
document.write('\x3Cscript>try{Typekit.load();}catch(e){}\x3C/script>');
};
@KingScooty
KingScooty / typekit.js
Last active March 7, 2016 14:36
Make Typekit non-blocking for smaller screens and serve up 2 different kits
<script>
var kit;
// Adjust the width threshold
if( window.innerWidth < 800 ) {
//Replace this with your mobile Typekit code
kit = 'xxxxx';
document.write('\x3Cscript src="//use.typekit.net/'+ kit +'.js" onload="try{Typekit.load();}catch(e){}" async>\x3C/script>');
} else {
//Replace this with your desktop Typekit code
kit = 'xxxxx';
@KingScooty
KingScooty / Gruntfile.js
Last active August 29, 2015 14:14
Using Grunt Assemble in Gulp
module.exports = function(grunt) {
grunt.initConfig({
assemble: {
options: {
partials: ['./app/templates/partials/**/*.hbs'],
layout: ['./app/templates/layouts/default.hbs'],
data: ['./app/data/*.json'],
helpers: ['./build-pipeline/_helpers/helper-*.js']
},
site: {