Skip to content

Instantly share code, notes, and snippets.

💭
Coding

mayeaux

💭
Coding
Block or report user

Report or block mayeaux

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mayeaux
mayeaux / web3-solc-contract-compile-deploy.js
Created Sep 8, 2019 — forked from tomconte/web3-solc-contract-compile-deploy.js
Compiling and deploying an Ethereum Smart Contract, using solc and web3.
View web3-solc-contract-compile-deploy.js
const fs = require('fs');
const solc = require('solc');
const Web3 = require('web3');
// Connect to local Ethereum node
const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
// Compile the source code
const input = fs.readFileSync('Token.sol');
const output = solc.compile(input.toString(), 1);
@mayeaux
mayeaux / send.py
Created Aug 31, 2019 — forked from ivandru/send.py
Simple Ether Transfer on Ropsten
View send.py
import web3
import json
from eth_account import Account
from web3 import Web3
w3 = Web3(Web3.HTTPProvider('https://ropsten.infura.io/v3/apiKey'))
acct = Account.privateKeyToAccount('private key')
nonce = w3.eth.getTransactionCount(acct.address)
transaction = {
'to' : toAccount,
'value': 1,
@mayeaux
mayeaux / sendRawTransaction.js
Created Aug 31, 2019 — forked from raineorshine/sendRawTransaction.js
Sends a raw transaction with web3 v1.0, ethereumjs-tx v2.1.0, and Infura
View sendRawTransaction.js
const Web3 = require('web3')
const Tx = require('ethereumjs-tx').Transaction
// connect to Infura node
const web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io/INFURA_KEY'))
// the address that will send the test transaction
const addressFrom = '0x1889EF49cDBaad420EB4D6f04066CA4093088Bbd'
const privKey = 'PRIVATE_KEY'
View deploy contract using web3js
const fs = require("fs");
const solc = require('solc')
let Web3 = require('web3');
let web3 = new Web3();
web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545'));
var input = {
'strings.sol': fs.readFileSync('strings.sol', 'utf8'),
'StringLib.sol': fs.readFileSync('StringLib.sol', 'utf8'),
View youtube api video category id list
2 - Autos & Vehicles
1 - Film & Animation
10 - Music
15 - Pets & Animals
17 - Sports
18 - Short Movies
19 - Travel & Events
20 - Gaming
21 - Videoblogging
22 - People & Blogs
@mayeaux
mayeaux / buzzfeed_api.md
Created Jul 16, 2019 — forked from chezclem/buzzfeed_api.md
BuzzFeed API - hackNY hackathon
View buzzfeed_api.md
                                               .--.
                                               `.  \
                                                 \  \
                                                  .  \
                                                  :   .
                                                  |    .
                                                  |    :
                                                  |    |
  ..._  ___                                       |    |
 `."".`''''""--..___                              |    |
@mayeaux
mayeaux / twitter-poll-result.js
Created Jun 24, 2019 — forked from vicke4/twitter-poll-result.js
Bookmarklet to view Twitter poll result without voting
View twitter-poll-result.js
(
function() {
var pod = document.getElementById('permalink-overlay-dialog');
if (!pod) return alert('Not a valid poll');
var iframeList = pod.getElementsByTagName('iframe');
if (iframeList.length === 0) return alert('Not a valid poll');
else if (iframeList.length > 1) return alert('Not a valid poll');
@mayeaux
mayeaux / setup-vagrant-macosx.md
Created May 20, 2018 — forked from tomysmile/setup-vagrant-macosx.md
How to Install Virtualbox and Vagrant on MacOSX
View setup-vagrant-macosx.md

Install Virtualbox && Vagrant for MacOSX

Vagrant uses Virtualbox to manage the virtual dependencies. You can directly download virtualbox and install or use homebrew for it.

$ brew cask install virtualbox

Now install Vagrant either from the website or use homebrew for installing it.

View github-wiki-how-to.md

How do I clone a GitHub wiki?

Any GitHub wiki can be cloned by appending wiki.git to the repo url, so the clone url for the repo https://myorg/myrepo/ is: git@github.com/myorg/myrepo.wiki.git (for ssh) or https://github.com/my/myrepo.wiki.git (for https).

You make edits, and commit and push your changes, like any normal repo.

How do I add images to a wiki page?

You need to clone the wiki repo and edit it on your system.

@mayeaux
mayeaux / gist:daf5b5f5e795870839f759d20c256ec6
Created Jan 1, 2018 — forked from mharsch/gist:5188206
serve HLS (HTTP Live Streaming) content from node.js
View gist:daf5b5f5e795870839f759d20c256ec6

HLS streaming from node

Provided that you already have a file or stream segmenter generating your .m3u8 playlist and .ts segment files (such as the ffmpeg 'hls' muxer), this little node server will serve up those files to an HLS compatible client (e.g. Safari). If you're using node for your streaming app already, this obviates the need to serve the HLS stream from a separate web server.

loosely based on https://gist.github.com/bnerd/2011232

// loosely based on https://gist.github.com/bnerd/2011232
// requires node.js >= v0.10.0
// assumes that HLS segmenter filename base is 'out'
// and that the HLS playlist and .ts files are in the current directory
You can’t perform that action at this time.