Skip to content

Instantly share code, notes, and snippets.

View positonic's full-sized avatar

J△MΞS positonic

View GitHub Profile
@positonic
positonic / gasPrice.js
Created June 9, 2020 08:34 — forked from thrilok209/gasPrice.js
Fetch GasPrice from eth gas station
// in nodeJs
const axios = require('axios')
async function getCurrentGasPrices() {
let response = await axios.get('https://ethgasstation.info/json/ethgasAPI.json')
let prices = {
low: response.data.safeLow / 10,
medium: response.data.average / 10,
high: response.data.fast / 10
}
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreieghfhem5gvtsa22itnw5cjaxsxovyuv44cyilplpk6giqloo4iim ✅
Create your profile today to start building social connection and trust online at https://3Box.io/
@positonic
positonic / Oh-My-ZSH
Last active September 25, 2019 14:00
Solution to the errors while running 'tab' command for OSX plugin or ZSH
# Errors while trying to setup OSX plugin for zshell (zsh)
execution error: Not authorised to send Apple events to System Events.
execution error: System Events got an error: osascript is not allowed to send keystrokes.
## solution
under settings > settings and privacy > automation .... tick system events for terminal
under settings > settings and privacy > accessibility ..... tick terminal
@positonic
positonic / pipe.js
Created June 27, 2019 09:52 — forked from jperasmus/pipe.js
"pipe" function that handles both sync and async functions
const pipe = (…functions) => input => functions.reduce((chain, func) => chain.then(func), Promise.resolve(input));
// Functions fn1, fn2, fn3 can be standard synchronous functions or return a Promise
pipe(fn1, fn2, fn3)(input).then(result => console.log(`Do with the ${result} as you please`))
@positonic
positonic / compose.js
Created June 27, 2019 09:51 — forked from jperasmus/compose.js
"compose" function that handles both sync and async functions
// Async compose
const compose = (…functions) => input => functions.reduceRight((chain, func) => chain.then(func), Promise.resolve(input));
// Functions fn1, fn2, fn3 can be standard synchronous functions or return a Promise
compose(fn3, fn2, fn1)(input).then(result => console.log(`Do with the ${result} as you please`))
const util = require('util')
console.log(util.inspect(object, {showHidden: false, depth: null}))
@positonic
positonic / docker-cleanup.bash
Last active September 7, 2018 08:11
Clean up disk space taken by docker
#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v
# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi
# remove unused volumes:
find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <(
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">