Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀

Scotty Vernon KingScooty

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

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:

View development.js
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 Feb 14, 2018
Linting Sass stylesheets with Stylelint
View gulpfile.js
/**
* 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 Feb 15, 2016
Linting CSS stylesheets with Stylelint
View gulpfile.js
/**
* 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 Nov 26, 2015
Periodically load JSON after initial load and update a chart.
View jsonChart.js
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 Dec 5, 2016
Using Bower install hooks to prep CSS files for SASS workflows
View .bower-postinstall.sh
#!/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 Feb 16, 2015
Remove Typekit from mobile devices all together.
View typekit.js
<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 Feb 3, 2015
Make Typekit non-blocking for smaller screens
View typekit.js
<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 Mar 7, 2016
Make Typekit non-blocking for smaller screens and serve up 2 different kits
View typekit.js
<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 Aug 29, 2015
Using Grunt Assemble in Gulp
View Gruntfile.js
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: {