Skip to content

Instantly share code, notes, and snippets.

View emailnjv's full-sized avatar

Nicholas Vincent emailnjv

  • New Jersey
View GitHub Profile
@emailnjv
emailnjv / new_file0
Created February 9, 2017 08:01
unzip tar
(sudo) tar -xvzf filename
@emailnjv
emailnjv / .sol
Created March 7, 2018 05:53
Solidity Method Callbacks
// using the callback
myContract.methods.myMethod(123).send({from: '0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe'}, function(error, transactionHash){
...
});
// using the promise
myContract.methods.myMethod(123).send({from: '0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe'})
.then(function(receipt){
// receipt can also be a new contract instance, when coming from a "contract.deploy({...}).send()"
});
@emailnjv
emailnjv / .js
Created March 28, 2018 17:26
Responsive iFrame through jQuery
jQuery(document).ready(function(){
var screenWidth = jQuery(window).width();
var videoWidth;
if (screenWidth < 770) {
if (screenWidth % 2 != 0) {
videoWidth = screenWidth - 1;
} else {
videoWidth = screenWidth;
}
videoHeight = videoWidth / 16 * 9;
@emailnjv
emailnjv / .go
Created April 15, 2018 03:34
Concurrent HTTP GET Response generator
// RespGen :: Concurrent HTTP GET Response generator
func RespGen(urls ...string) <-chan *http.Response {
var wg sync.WaitGroup
out := make(chan *http.Response)
wg.Add(len(urls))
for _, url := range urls {
go func(url string) {
req, err := http.NewRequest("GET", url, nil)
if err != nil {
panic(err)
@emailnjv
emailnjv / Add SASS to existing Vue project
Created May 2, 2018 04:03
Add SASS to existing Vue project
npm install -D sass-loader node-sass
@emailnjv
emailnjv / nightly-compiler.sh
Last active December 6, 2018 18:30
Rust: Make current directory use nighlty compiler
rustup override add nightly
@emailnjv
emailnjv / .sh
Created January 7, 2019 21:24
Docker Write Log to File
docker logs containername >& logs/myFile.log
let cells = document.getElementsByClassName("delegate-item");
let returnDelegates = [];
for (let i in cells) {
let inner_lis = cells[i].getElementsByTagName("li");
for (let x in inner_lis) {
let inner = inner_lis.innerHTML.trim();
if (inner.indexOf("Is public delegate?") > -1) {
let i_tag = inner_lis[x].getElementsByTagName("i");
if (i_tag.classList.contains("text-green")) {
returnDelegates.push(cells[i]);
query user($uuid: uuid) {
user(where: { uuid: { _eq: $uuid } }) {
user2holding: Users_to_Holdings {
holding_address
id
holdings: Holding {
token_name
token: Token {
symbol
marketData: Market_Data(limit: 1, order_by: { created_at: desc }) {