Skip to content

Instantly share code, notes, and snippets.

View montyanderson's full-sized avatar

Monty Anderson montyanderson

View GitHub Profile
<?php
function randomId($length) {
$chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
$max = strlen($chars) - 1;
$id = "";
for($i = 0; $i < $length; $i++) {
$id .= $chars[random_int(0, $max)];
}
/* jshint ignore:start */
/* jshint ignore:end */
define('my-new-app/adapters/application', ['exports', 'ember-data', 'my-new-app/config/environment'], function (exports, DS, ENV) {
'use strict';
var Adapt = DS['default'].ActiveModelAdapter.extend({
namespace: "api/v1",
/* previous code */
app.post("/signup", (req, res) => {
var check = client.exists(req.body.username);
if(check == 0) {
res.send("sorry that name already exists");
//res.render("exists", {
// name : req.body.username
// });
0x5acba08bf9a325bf8fedbde120f3a375b349d5ff
function mix(streams) {
const length = Math.max(...streams.map(s => s.length));
const numberOfChannels = Math.max(...streams.map(s => s.numberOfChannels));
const sampleRate = streams[0].sampleRate;
// assume all streams have the same sample rate for now
const result = new AudioBuffer({
length,
numberOfChannels,
sampleRate
pragma solidity ^0.4.10;
contract Account {
string public name;
string public bio;
string[] public posts;
address public owner;
address[] public following;
pragma solidity ^0.4.10;
contract OliverDollar {
mapping(address => uint) balances;
function OliverDollar() {
balances[msg.sender] = 1000000;
}
function balanceOf(address owner) constant returns (uint256) {
pragma solidity ^0.4.10;
contract JesseCoin {
address jesse;
mapping(address => uint) balance;
function JesseCoin() {
jesse = msg.sender;
}
{
"nonce": "0x0000000000000042",
"timestamp": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x0",
"gasLimit": "0x8000000",
"difficulty": "0x400",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x3333333333333333333333333333333333333333",
"alloc": {
{
"config": {
"chainId": 113,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"difficulty": "200000",
"gasLimit": "0xffffffff",
"alloc": { },