Skip to content

Instantly share code, notes, and snippets.

View colynb's full-sized avatar
🎯
Focusing

C Brown colynb

🎯
Focusing
View GitHub Profile
@colynb
colynb / affix.html
Created May 11, 2017 00:54 — forked from Cezarion/affix.html
Affix js with vanilla js
<script type="text/javascript">
window.onscroll = scroll;
function scroll () {
var scrollTop = window.pageYOffset;
console.log(scrollTop);
if( scrollTop > 363 ){
document.getElementById('summary').style.top="20px";
document.getElementById('summary').style.position="fixed";
}
else
@colynb
colynb / gist:5421554b4b23f45963075f5aad9e8286
Created December 16, 2016 19:34 — forked from jrmadsen67/gist:bd0f9ad0ef1ed6bb594e
Laravel Quick Tip: Handling CsrfToken Expiration gracefully
Quick tip for handling CSRF Token Expiration - common issue is when you use csrf protection is that if
a form sits there for a while (like a login form, but any the same) the csrf token in the form will
expire & throw a strange error.
Handling it is simple, and is a good lesson for dealing with other types of errors in a custom manner.
In Middleware you will see a file VerifyCsrfToken.php and be tempted to handle things there. DON'T!
Instead, look at your app/Exceptions/Handler.php, at the render($request, Exception $e) function.
All of your exceptions go through here, unless you have excluded them in the $dontReport array at the
@colynb
colynb / 0_reuse_code.js
Created September 11, 2016 20:04
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@colynb
colynb / index.html
Last active August 29, 2015 14:06 — forked from anonymous/index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<style id="jsbin-css">
.js-banner {
padding: 40px;
background: #a4b357;
@colynb
colynb / dabblet.css
Created December 22, 2011 03:30 — forked from chriscoyier/dabblet.css
Checkbox Hack
/* Checkbox Hack */
input[type=checkbox] {
position: absolute;
top: -9999px;
left: -9999px;
}
label {
-webkit-appearance: push-button;
-moz-appearance: button;