Skip to content

Instantly share code, notes, and snippets.

Avatar

Will Binns wbnns

View GitHub Profile
@wbnns
wbnns / web3.rb
Created Apr 7, 2021
Code for the web3.rb initializer when creating an ethereum wallet with ruby.
View web3.rb
$web3 = Web3::Eth::Rpc.new host: 'mainnet.infura.io',
port: 443,
connect_options: {
open_timeout: 20,
read_timeout: 140,
use_ssl: true,
rpc_path: "/v3/#{ENV['INFURA_API_KEY']}"
}
@wbnns
wbnns / jsonIntoGoogleSheet.js
Last active Mar 14, 2021
How to pull information from an API and load it directly into Google Sheets
View jsonIntoGoogleSheet.js
/**
* Imports JSON data to your spreadsheet
* @param url URL of your JSON data as string
* @param xpath simplified xpath as string
* @customfunction
*/
function ImportJSON(url,xpath){
try{
@wbnns
wbnns / fix_ubuntu_software_center.sh
Created Dec 23, 2020
How to fix Ubuntu 20.04 Software Center not loading
@wbnns
wbnns / default_java.sh
Created Dec 23, 2020
How to set default version of Java to be used on Linux
View default_java.sh
sudo update-alternatives --config java
@wbnns
wbnns / find_replace.sh
Created Dec 23, 2020
Find and replace with sed in directory and sub directories.
View find_replace.sh
find ./ -type f -exec sed -i -e 's/apple/orange/g' {} \;
@wbnns
wbnns / application.html.erb
Last active Aug 4, 2020
What opengraph metadata tags look like in Ruby on Rails
View application.html.erb
<meta property="og:site_name" content="Scyberia" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Scyberia" />
<meta property="og:description" content="Work from anywhere and get paid bitcoin." />
<meta property="og:url" content="https://scyberia.com/" />
<%= tag :meta, property: 'og:image', content: image_url('scyberia-open-graph.jpg') %>
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Scyberia" />
<meta name="twitter:description" content="Work from anywhere and get paid bitcoin." />
<meta name="twitter:url" content="https://scyberia.com/" />
@wbnns
wbnns / dappl.md
Created Jul 14, 2020
Draft of a theoretical license that could potentially be used in fintech for digital assets and/or payment protocols.
View dappl.md

Digital Asset / Payment Protocol License (DAPPL)

Copyright <YEAR> <COPYRIGHT HOLDER>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

@wbnns
wbnns / cmcl.rb
Created Jul 14, 2020
Tweets the biggest losses amongst cryptocurrencies over the course of the last hour.
View cmcl.rb
require 'chatterbot/dsl'
require 'httparty'
require 'json'
require 'rubygems'
url = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?volume_24h_min=10000000&sort=percent_change_1h&sort_dir=asc&limit=10'
response = HTTParty.get(url, {headers: {"X-CMC_PRO_API_KEY" => "TBD"}})
response_array = response.to_a
c1symbol = response_array[1][1][0]["symbol"]
@wbnns
wbnns / cmcg.rb
Created Jul 14, 2020
Tweets the biggest gains amongst cryptocurrencies during over the course of the last hour.
View cmcg.rb
require 'chatterbot/dsl'
require 'httparty'
require 'json'
require 'rubygems'
url = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?volume_24h_min=10000000&sort=percent_change_1h&sort_dir=desc&limit=10'
response = HTTParty.get(url, {headers: {"X-CMC_PRO_API_KEY" => "TBD"}})
response_array = response.to_a
c1symbol = response_array[1][1][0]["symbol"]
@wbnns
wbnns / cmc10.rb
Created Jul 14, 2020
Tweets the one-hour average price change for the ten largest cryptocurrencies by market capitalization.
View cmc10.rb
require 'chatterbot/dsl'
require 'httparty'
require 'json'
require 'rubygems'
url = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?start=1&limit=10'
response = HTTParty.get(url, {headers: {"X-CMC_PRO_API_KEY" => "TBD"}})
response_array = response.to_a
c1symbol = response_array[1][1][0]["symbol"]