Skip to content

Instantly share code, notes, and snippets.

View panoply's full-sized avatar
🥛
Rich in the hood

ΝΙΚΟΛΑΣ panoply

🥛
Rich in the hood
View GitHub Profile
@panoply
panoply / essentials.md
Last active December 7, 2016 15:28
Vanilla JS Essentials

Load (654 bytes)

Asynchronous asset loading. Load.js is my Require.js alternative. It’s this handy little script that handles asynchronous loading of assets and “per-page” specific javascript and css files.

Store (3.4 kb)

Work with Local storage. Store.js makes working with your browser’s local storage an utter ease and supports legacy browsers.

Cookie (3.59 kb) JS Cookie enables the storage of cookies.

@panoply
panoply / iso-current.json
Last active April 27, 2017 18:11
Relative Country ISO to Currency
/**
* Relative ISO to Currency JSON.
* This is custom list of countries that are relative to brixtol.com
*/
var geo = {
"locals": [
{
"country": "US",
@panoply
panoply / brxtl.js
Created August 2, 2017 19:27
geoIP
```
var GeoIP = (function () {
var fn = {};
var data = {};
var geo = [];
var rate;
fn.init = function(options) {
@panoply
panoply / source.js
Created October 16, 2017 11:18
Source Code (Puffer email)
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<title></title>
<!--[if !mso]><!-- -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!--<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
@panoply
panoply / base.mjml
Created October 16, 2017 11:51
MJML Base Skeleton
<mjml>
<mj-head>
<mj-attributes>
<mj-text padding="0" />
<mj-class name="blue" color="blue" />
<mj-class name="big" font-size="20px" />
<mj-all font-family="Helvetica" color="#000" />
</mj-attributes>
</mj-head>
<mj-body>
@panoply
panoply / localstorage-wait.js
Created November 22, 2017 11:50
Aysnc LocalStorage method. Use as Static fn waiting for localStorage value to be entered.
static wait(key) {
return Promise
.resolve()
.then(() => {
return localStorage.getItem(key)
});
}
class Example {
fn(){
const root = document.querySelector('#locale')
const component = {
view(vnode){
return m(".ul.dash", [
m('li.shipping', [
@panoply
panoply / get-started.html
Created March 22, 2018 23:57
Mithril – Get Started
<body>
<script src="//unpkg.com/mithril/mithril.js"></script>
<script>
var root = document.body
// your code goes here!
</script>
</body>
@panoply
panoply / turboclick.js
Created March 31, 2018 16:31
Prefetching Turbolinks 5
import Turbolinks from 'turbolinks';
export default () => {
const OldHttpRequest = Turbolinks.HttpRequest;
Turbolinks.CachedHttpRequest = class CachedHttpRequest extends Turbolinks.HttpRequest {
constructor(_, location, referrer) {
super();
super(this, location, referrer);
@panoply
panoply / index.html
Last active March 19, 2021 07:20
Rollup Configuration – Uses Buble, SASS and Serve. Use with Mithril.js
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Mithril Rollup.js</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="bundle.css" rel="stylesheet" />
</head>
<body>
<div id="app"></div>