Skip to content

Instantly share code, notes, and snippets.

View kelsS's full-sized avatar
🍵

Kelsey S. kelsS

🍵
View GitHub Profile
@kelsS
kelsS / Mac OS X: Open in Visual Studio Code
Created November 19, 2018 21:42 — forked from tonysneed/Mac OS X: Open in Visual Studio Code
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Service
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*"
- Save it as something like "Open in Visual Studio Code"
@kelsS
kelsS / gist:a1b00b6e3872309aeae3b7fc82043335
Created August 21, 2018 14:01 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
var Arch; if (!Arch) Arch = {}; // set up custom namespace 'Arch'
Arch.AjaxPagination = function(paginationContainer, storiesContainer, filtersContainer) {
// Only html5 browsers can use ajax pagination. We don't want no stinkin' hashbang URLs.
if (!history.pushState) {
return;
}
this.$paginationContainer = $(paginationContainer);
@kelsS
kelsS / flickr.js
Created June 29, 2018 17:52
jQuery plugin to integrate a Flickr PhotoStream set into your website.
/*!
* William DURAND <[email protected]>
* MIT Licensed
*
* GistID: 5705453
*
* Usage:
*
* $('.photos').flickrPhotoStream({ id: '12345', setId: '67890' });
*
$(document).ready(function(){
//setup info
var id = "";//<- You user id
var num = 1;//<- How many images to pull in
// Grab JSON from Flickr
$.getJSON("http://api.flickr.com/services/feeds/groups_pool.gne?id="+id+"&lang=en-us&format=json&jsoncallback=?", displayImages);
//
function displayImages(data)
/*
---
name: List.CheckBox
license: MIT-style license.
copyright: Copyright (c) 2011 [Ryan Florence](http://ryanflorence.com/).
author: Ryan Florence
@kelsS
kelsS / index.html
Created June 15, 2018 19:10 — forked from benschwarz/index.html
Using ARIA roles with <header>, <footer> and <aside>
<!doctype html>
<html>
<body>
<header role="banner">
<a href="/" rel="home">My company</a>
<nav role="navigation">
<a href="/about">About</a>
<a href="/contact">Contact</a>
</nav>
</header>
@kelsS
kelsS / index.html
Created June 6, 2018 20:53 — forked from seancdavis/index.html
Full-Size, Looping Background Video with YouTube Video
<style>
.bg-video {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
overflow: hidden;
z-index: -1;
}
@kelsS
kelsS / watchResize.js
Created June 5, 2018 19:04 — forked from aarongustafson/watchResize.js
Efficient callback management for window.onresize
(function( window ){
window.watchResize = function( callback ){
var resizing;
callback.size = 0;
function done()
{
var curr_size = window.innerWidth;
clearTimeout( resizing );
resizing = null;
// only run on a true resize
@kelsS
kelsS / browser-width.js
Created June 5, 2018 19:03 — forked from glueckpress/browser-width.js
Track browser size in real time, do stuff at certain breakpoints. A JavaScript media query, essentially. Borrowed from @aarongustafson.
// watch browser width on resize
var browser_width = 0;
window.watchResize(function(){
browser_width = window.innerWidth || document.body.offsetWidth;
});
// do stuff after breakpoint
window.watchResize(function(){
var threshold = 400;
if ( browser_width >= threshold ) {