Skip to content

Instantly share code, notes, and snippets.

View kelsS's full-sized avatar
🍵

Kelsey S. kelsS

🍵
View GitHub Profile
@kelsS
kelsS / mysql-docker.sh
Created February 22, 2018 15:53 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@kelsS
kelsS / change-class-on-scroll.html
Created May 23, 2018 19:32 — forked from ohiosveryown/change-class-on-scroll.html
Vanilla JS – change/add class based on scroll position.
// https://codepen.io/cmykw/pen/gemxJm
// layout
<nav/>
// style
<style>
body { min-height: 200vh; }
nav {
@kelsS
kelsS / device.css
Created June 5, 2018 16:44 — forked from jsoverson/device.css
Quick css hacks to target android/ios
.visible-android {
display:none;
}
.visible-ios {
display:none;
}
.on-device .visible-android, .on-device .visible-android {
display:inherit;
}
.device-ios .visible-android {
@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 ) {
@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 / 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 / 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>
/*
---
name: List.CheckBox
license: MIT-style license.
copyright: Copyright (c) 2011 [Ryan Florence](http://ryanflorence.com/).
author: Ryan Florence
$(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)
@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' });
*