Skip to content

Instantly share code, notes, and snippets.

View pi0neerpat's full-sized avatar
🤠

Patrick Gallagher pi0neerpat

🤠
View GitHub Profile
pragma solidity ^0.4.24;
import 'openzeppelin-solidity/contracts/ownership/Ownable.sol';
contract Name is Ownable{
string public name;
constructor(string _name) public {
name = _name;
}

Supporting Sleep & Battery Life

Only available ^1.30 September 7, 2018 (my X1C 6th gen came with this)

In BIOS settings: Config > Sleep State > Linux

Check if successful with

dmesg | grep -i "acpi: (supports"

@pi0neerpat
pi0neerpat / remix-plugin-how-to.md
Created September 1, 2019 10:36
How to create a Remix Plugin

Create your own Remix plugin

These are my personal notes for creating this Remix Plugin, in case you need some help creating your own

Getting Started

Fork whichever plugin is most similar to your needs. You can use this one, or play with all of them at remix-alpha. For this project I cloned the ethdocs plugin, since it was most similar to my vision.

Skim through the remix-plugin Readme of course.

@pi0neerpat
pi0neerpat / metamasksurvey.js
Created March 26, 2020 15:23
Survey "How I use MetaMask"
import { getErrorResponse } from '../general';
import { ethers } from 'ethers';
export const isWeb3EnabledBrowser = () => {
return (
typeof window !== 'undefined' && typeof window.ethereum !== 'undefined'
);
};
export const unlockWallet = async () => {
@pi0neerpat
pi0neerpat / loadwallet.js
Created March 26, 2020 15:48
load wallet
async loadContracts({
walletProvider,
contractNames,
allowancesRequested,
balancesRequested,
}) {
console.log("lol")
try {
ethers.errors.setLogLevel("error") // "debug", "default", "info", "warn", "off"
const COMPOUND_RATE_API =
'https://api.compound.finance/api/v2/ctoken?addresses[]=0x5d3a536e4d6dbd6114cc1ead35777bab948e3643';
export const getCompoundRate = async () => {
try {
const res = await axios.get(COMPOUND_RATE_API);
const rate = res.data.cToken[0].supply_rate.value;
return { rate, formattedRate: Math.round(rate * 10000) / 100 };
} catch (error) {
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
@pi0neerpat
pi0neerpat / verdaccio install.md
Last active August 18, 2020 16:32
verdaccio install

Verdaccio

Learn about Private Packages here link

link

Commands

yarn config set registry http://localhost:4873