I hereby claim:
- I am eddmann on github.
- I am eddmann (https://keybase.io/eddmann) on keybase.
- I have a public key ASCtR4CJdl_FFsytpfmf0RRuxlyRrgP8lXazqBwXWkuQfAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
const fetchLatestBlock = () => | |
fetch(`https://blockchain.info/q/latesthash?cors=true`) | |
.then(r => r.text()); | |
const fetchMerkleRootAndTransactions = block => | |
fetch(`https://blockchain.info/rawblock/${block}?cors=true`) | |
.then(r => r.json()) | |
.then(d => [d.mrkl_root, d.tx.map(t => t.hash)]); | |
const random = arr => |
const fetchLatestBlock = () => | |
fetch(`https://blockchain.info/q/latesthash?cors=true`) | |
.then(r => r.text()); | |
const fetchMerkleRootAndTransactions = block => | |
fetch(`https://blockchain.info/rawblock/${block}?cors=true`) | |
.then(r => r.json()) | |
.then(d => [d.mrkl_root, d.tx.map(t => t.hash)]); | |
const toBytes = hex => |
'use strict'; | |
const AWS = require('aws-sdk'); | |
module.exports.stateChange = (event, context, callback) => { | |
const { state, id, region } = event; | |
const ec2 = new AWS.EC2({ region }); | |
ec2[`${state}Instances`]({ InstanceIds: [id] }).promise() |
'use strict'; | |
const AWS = require('aws-sdk'); | |
module.exports.start = (event, context, callback) => { | |
const ec2 = new AWS.EC2({ region: event.region }); | |
ec2.startInstances({ InstanceIds: [event.id] }).promise() | |
.then(() => callback(null, `Successfully started ${event.id}`)) | |
.catch(err => callback(err)); |
// Demonstration video can be found at: https://youtu.be/_gJyK1-NGq8 | |
// ModifyEC2InstanceType | |
const AWS = require('aws-sdk'); | |
exports.handler = (event, context, callback) => { | |
const { instanceId, instanceRegion, instanceType } = event; | |
const ec2 = new AWS.EC2({ region: instanceRegion }); |
// Demonstration video can be found at: https://youtu.be/roAerKVfq-Y | |
// StopEC2Instance | |
const AWS = require('aws-sdk'); | |
exports.handler = (event, context, callback) => { | |
const ec2 = new AWS.EC2({ region: event.instanceRegion }); | |
ec2.stopInstances({ InstanceIds: [event.instanceId] }).promise() |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
"use strict"; |
<?php | |
class SecureSessionHandler extends SessionHandler { | |
protected $key, $name, $cookie; | |
public function __construct($key, $name = 'MY_SESSION', $cookie = []) | |
{ | |
$this->key = $key; | |
$this->name = $name; |
// Prototypical Model | |
var UserPrototype = {}; | |
UserPrototype.constructor = function(name) | |
{ | |
this._name = name; | |
}; | |
UserPrototype.getName = function() | |
{ | |
return this._name; |