Skip to content

Instantly share code, notes, and snippets.

View superposition's full-sized avatar

Eric Manganaro superposition

View GitHub Profile
@superposition
superposition / mint.html
Created May 6, 2022 01:47 — forked from dievardump/mint.html
Easy interaction with a contract
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/ethers.umd.min.js"></script>
</head>
<body>
<script>
@superposition
superposition / eventemitter.js
Created October 23, 2018 09:54 — forked from mudge/eventemitter.js
A very simple EventEmitter in pure JavaScript (suitable for both node.js and browsers).
/* Polyfill indexOf. */
var indexOf;
if (typeof Array.prototype.indexOf === 'function') {
indexOf = function (haystack, needle) {
return haystack.indexOf(needle);
};
} else {
indexOf = function (haystack, needle) {
var i = 0, length = haystack.length, idx = -1, found = false;
@superposition
superposition / index.html
Created August 5, 2018 00:49
react-modal sample
<div id="main">
</div>
@superposition
superposition / index.html
Created July 27, 2018 04:59
Kiosk Event Schedule — A Concept
<main>
<section v-for="(day, index) in schedule">
<header>
Day {{index+1}} &mdash; {{day.date | date}}
</header>
<ul>
<li v-for="slot in day.agenda" v-bind:class="{ current: checkTime(slot.range[0], slot.range[1]) }">
<h3><b>{{slot.display.h}}</b>{{slot.display.m}}{{slot.display.a}}</h3>
<div v-html="slot.desc"></div>
<div><small v-html="slot.location"></small></div>
@superposition
superposition / gist:cd97544345574879e0931398c169dfbf
Created June 27, 2018 18:01
Gist for installation of Docker
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@superposition
superposition / install.sh
Created June 26, 2018 06:01 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@superposition
superposition / destructuring.js
Created May 1, 2018 22:39 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@superposition
superposition / django-strorages.json
Created April 21, 2018 08:56 — forked from rockymeza/django-strorages.json
AWS IAM Policy for S3 for django-storages
{
   "Statement":[
      {
         "Effect":"Allow",
       
         "Action":[
            "s3:ListAllMyBuckets"
         ],
         "Resource":"arn:aws:s3:::*"
      },
@superposition
superposition / LambdaBase.py
Created April 17, 2018 05:11 — forked from benkehoe/LambdaBase.py
Code pattern for implementing class-based AWS Lambda handlers in Python
"""Base class for implementing Lambda handlers as classes.
Used across multiple Lambda functions (included in each zip file).
Add additional features here common to all your Lambdas, like logging."""
class LambdaBase(object):
@classmethod
def get_handler(cls, *args, **kwargs):
def handler(event, context):
return cls(*args, **kwargs).handle(event, context)
return handler
@superposition
superposition / Django_ReactJS_Webpack_project_setup.md
Created February 15, 2018 19:28 — forked from Belgabor/Django_ReactJS_Webpack_project_setup.md
Set up a Django + ReactJS project with Webpack manager

Guide on how to create and set up your Django project with webpack, npm and ReactJS :)

Hopefully this will answer "How do I setup or start a Django project?" I was trying to set up my own website, and there was a lot to read, learn and digest! Therefore, I put this together which is a collection of all the guides/blog posts/articles that I found the most useful. At the end of this, you will have your barebones Django app configured and ready to start building :)

NOTE: This guide was built using Django 1.9.5, NodeJS 4+ with NPM 3+

1. Setting up your dev environment