Skip to content

Instantly share code, notes, and snippets.

View mayeaux's full-sized avatar
💭
Coding

Anthony mayeaux

💭
Coding
View GitHub Profile
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'),
@bertrandmartel
bertrandmartel / passport-youtube.js
Last active July 3, 2022 16:44
Example of using youtube API on nodejs with passport
var app = require('express')(),
passport = require('passport'),
GoogleStrategy = require('passport-google-oauth').OAuth2Strategy,
mongoose = require('mongoose'),
google = require('googleapis'),
OAuth2 = google.auth.OAuth2,
session = require('express-session');
var config = {
clientID: 'CLIENT_ID',
@ulyssesr
ulyssesr / nginx.conf
Last active March 18, 2025 17:57
Nginx RTMP Setup
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
@tomconte
tomconte / web3-solc-contract-compile-deploy.js
Created December 13, 2016 09:32
Compiling and deploying an Ethereum Smart Contract, using solc and web3.
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);
@mikoim
mikoim / README.md
Last active March 30, 2025 06:04
[Updated! Aug 14 2020] YouTube recommended encoding settings on ffmpeg (+ libx264)

Parameters

Container: MP4

Parameter YouTube recommends setting
-movflags faststart moov atom at the front of the file (Fast Start)

Video codec: H.264

@r4hul-in
r4hul-in / index.sh
Created November 20, 2016 11:13
follow everyone on gab
#!/bin/bash
# follow everyone on gab.ai easily
# this may or may not break at any time, as this api is unofficial/undocumented/whatever you want to call it.
# insert your cookies into /tmp/cookies
# you can extract them using EditThisCookie, in the Netscape HTTP cokie format.
# limited to first 10000 users on gab, change the number in $(seq if there are more users in the future
# of course, 200 = success, anything else = failure
for i in $(seq 10000)
do
curl -o /dev/null --silent --head --write-out '%{http_code} -' -X POST --cookie /tmp/cookie https://gab.ai/users/$i/follow
@nepsilon
nepsilon / how-to-force-a-file-download-with-ningx.md
Last active January 10, 2022 05:29
How to force a file download with Nginx? — First published in fullweb.io issue #73

How to force a file download with Nginx?

In short:

add_header Content-Disposition 'attachment; filename="foo.txt"';

We’re just adding a Content-Disposition header in the response. You can specify the file name, here we’re using foo.txt.

@bertrandmartel
bertrandmartel / aggregation_lookup.md
Last active December 22, 2023 13:32
MongoDB $lookup aggregation example

MongoDB $lookup aggregation

SO link

db.votes.aggregate([{
    $lookup: {
        from: "users",
        localField: "createdBy",
        foreignField: "_id",
ffmpeg -i data/video.mp4 -vcodec h264 -b:v 1000k -acodec mp2 data/output.mp4
@umidjons
umidjons / connect-remote-mongo-via-ssh-tunnel.md
Last active December 12, 2022 07:24
Create ssh tunnel and connect to the remote mongo database on command line

Create ssh tunnel and connect to the remote mongo database on command line

Assume followings:

/mykeys/.ssh/prodserver.pem - is a certificate file

umid - is a user name

111.111.111.111 - is a remote host, that mongodb runs