Skip to content

Instantly share code, notes, and snippets.

View mradambeck's full-sized avatar

Adam Beck mradambeck

  • HouseCanary
  • Alameda, CA
View GitHub Profile
@mradambeck
mradambeck / areCookiesEnabled.js
Last active November 13, 2018 23:36
Check for cookies in JS
export const areCookiesEnabled = () => {
let cookieEnabled = !!navigator.cookieEnabled;
if (typeof navigator.cookieEnabled === 'undefined' && !cookieEnabled) {
document.cookie = 'testcookie';
cookieEnabled = document.cookie.indexOf('testcookie') !== -1;
}
return cookieEnabled;
};
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@mradambeck
mradambeck / es6.js
Last active May 24, 2016 23:10
Quick and Easy ES6 stuff to use
// ARROWS
[1, 2, 3].map(function (num) { return num * 2 }) // <- [2, 4, 6]
// IS NOW:
[1, 2, 3].map(num => num * 2) // <- [2, 4, 6]
// BACKTICK STRINGS! ````````
// String interpolation
var name = "Bob", time = "today";
@mradambeck
mradambeck / sass-demo.md
Last active May 11, 2016 19:07
SASS: WDI lightning talk - supplemental reader

SASS

Summary: SASS brings common programming ideas and applies them to CSS. This makes CSS much easier and quicker to work with, and allows you create CSS dynamically based off of variables.

Setup: The thing about Rails and SASS is that it's there by default! All you need to do is change the .css file to a .scss file. Easy peasy!

Setting variables:

Variables are defined with a $ sign and can be used across your CSS:

@mradambeck
mradambeck / 0_reuse_code.js
Created August 22, 2014 22:01
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