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
Created November 8, 2012 12:06
Symlinking a folder from a git submodule for use in a project

#Symlink a folder from a git submodule for use in a project

I recently came across a need to try this out on a project i was working on. So here's how to do it, incase anyone else finds themselves in the same situation.

##Set up your submodule in a seperate directory.

Run this command from your project root.

git submodule add http://example.com/repo.git ./submodules/repo

@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 / 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:

@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
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';
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 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 / Folder Preferences
Created February 27, 2012 15:25 — forked from chrisyour/Folder Preferences
Show hidden files and hidden folders (except .git) in your TextMate project drawer
# Want to show hidden files and folders in your TextMate project drawer? Simple, just modify the file and folder patterns in TextMate's preferences.
# Instructions:
# Go to TextMate > Preferences...
# Click Advanced
# Select Folder References
# Replace the following:
# File Pattern
@KingScooty
KingScooty / binary_search.js
Created November 10, 2011 16:59 — forked from martinogden/binary_search.js
Binary Search Algorithm
/**
* @param {list} data List of integers sorted ascending
* @param {int} find Integer to search for
* @param {int} start Min array index
* @param {int} end Max array index
* @return {int} Index of 'find' or -1 if not found
*/
var binarySearch = function (data, find, start, end) {
var mid = start + (end - start) / 2;