Skip to content

Instantly share code, notes, and snippets.

Avatar
😎
Being cool and writing code

Sivli Embir Sivli-Embir

😎
Being cool and writing code
View GitHub Profile
@justincy
justincy / README.md
Last active Jul 29, 2021
Configure Storybook to work with Next.js, TypeScript, and CSS Modules
View README.md

In addition to the Storybook for React setup, you'll also need to install these packages:

npm i -D @babel/core babel-loader css-loader style-loader
View normalize.coffee
creationTime = new Date()
profile =
name: ''
stripeId: ''
created: creationTime.getTime()
address: ''
city: ''
state: ''
country: ''
limit: 2
@wboykinm
wboykinm / index.html
Created Nov 10, 2013
Leaflet + D3 + Vector Tiles (via Nelson Minar)
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>D3 GeoJSON in Leaflet</title>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.4.0/mapbox.css' rel='stylesheet' />
<!--[if lte IE 8]>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.4.0/mapbox.ie.css' rel='stylesheet'>
<![endif]--><style>
html, body, #map { height: 100%;width:100%; background:#020B26;position:absolute;}
body { padding: 0; margin: 0; }
path { stroke-linejoin; round; stroke-linecap: round; fill: none}
@matb33
matb33 / aws-sdk.js
Created Apr 12, 2013
AWS SDK Smart Package -- Exposes the SDK as AWS.SDK and provides a helper function to sign URLs
View aws-sdk.js
AWS = (function () {
var SDK = Npm.require("aws-sdk");
var crypto = Npm.require("crypto");
var url = Npm.require("url");
function getAuthenticatedURL(fullUrl, accessKeyID, secretAccessKey, expires) {
/*
Signature = URL-Encode( Base64( HMAC-SHA1( YourSecretAccessKeyID, UTF-8-Encoding-Of( StringToSign ) ) ) );
View Controller.js
(function (Controller, _) {
"use strict";
Controller.BasicController = function (parameters) {
var paramKeys = _.keys(parameters);
this.canDispatch = function (match) {
return _.every(paramKeys, function (c) {
return parameters[c] === match.getParam(c);
});
@robnyman
robnyman / blob-filereader-localStorage.js
Last active Mar 31, 2021
Get file as a blob, read through FileReader and save in localStorage
View blob-filereader-localStorage.js
// Getting a file through XMLHttpRequest as an arraybuffer and creating a Blob
var rhinoStorage = localStorage.getItem("rhino"),
rhino = document.getElementById("rhino");
if (rhinoStorage) {
// Reuse existing Data URL from localStorage
rhino.setAttribute("src", rhinoStorage);
}
else {
// Create XHR and FileReader objects
var xhr = new XMLHttpRequest(),