Skip to content

Instantly share code, notes, and snippets.

View tpscrpt's full-sized avatar
🏠
Working from home

Jeremi G. tpscrpt

🏠
Working from home
View GitHub Profile
const ytdl = require('youtube-dl')
const express = require('express')();
const { exec } = require('child_process')
const songPlayer = exec('ffplay -i pipe:0')
express.post('/song', (req, res) => {
req.on('data', (chunk) => {
songPlayer.stdin.write(chunk)
})
@tpscrpt
tpscrpt / ERC20.sol
Created August 3, 2018 18:32
Solidity ERC20 semantics
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);