Skip to content

Instantly share code, notes, and snippets.

:octocat:
Coding

Miguel Mota miguelmota

:octocat:
Coding
Block or report user

Report or block miguelmota

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@miguelmota
miguelmota / README.md
Created Jan 17, 2020
Web security checklist
View README.md
@miguelmota
miguelmota / version_bump.sh
Created Jan 17, 2020
NPM bump version tag locally
View version_bump.sh
npm version prerelease --preid=beta
@miguelmota
miguelmota / Dockerfile
Created Jan 15, 2020
Dockerfile postgresql custom username and password
View Dockerfile
FROM postgres:12.1
ENV POSTGRES_PASSWORD=docker
ENV POSTGRES_USER=docker
@miguelmota
miguelmota / Dockerfile
Created Jan 15, 2020
Dockerfile ruby standalone_migrations postgresql example
View Dockerfile
FROM ruby:2.6.5-alpine3.10
# Install dependencies
RUN apk update && apk add build-base bash postgresql-dev zlib-dev
# Install gems
RUN gem install rake dotenv pg standalone_migrations
# Set postgres environment variables
ENV POSTGRES_HOST=127.0.0.1
@miguelmota
miguelmota / Example.sol
Last active Jan 13, 2020
Solidity example of how to read USD price of ETH onchain using MakerDAO medianizer price feed contract
View Example.sol
pragma solidity >=0.4.22 <0.6.0;
interface IMakerDaoMedianizer {
function read() external view returns (bytes32);
}
contract Example {
IMakerDaoMedianizer makerDaoMedianizer;
constructor(address _makerDaoMedianizer) public {
@miguelmota
miguelmota / eth_usd_price.js
Last active Jan 13, 2020
Web3.js read ETH price from MakerDAO medianizer price feed onchain smart contract
View eth_usd_price.js
const medianizerAbi = require('./medianizerAbi.json')
const ethers = require('ethers')
const provider = new ethers.getDefaultProvider('mainnet')
const medianizerAddress = '0x729D19f657BD0614b4985Cf1D82531c67569197B'
const medianizerContract = new ethers.Contract(medianizerAddress, medianizerAbi, provider)
;(async () => {
const value = await medianizerContract.read()
const usdPrice = ethers.utils.formatEther(value)
@miguelmota
miguelmota / programs
Last active Jan 11, 2020
Linux reddit unix p*rn programs
View programs
i3-gaps neofetch gotop cava tty-clock
@miguelmota
miguelmota / install_tty_clock.sh
Last active Jan 11, 2020
Linux Fedora install tty-clock
View install_tty_clock.sh
git clone https://github.com/xorg62/tty-clock
cd tty-clock
sudo dnf install ncurses ncurses-devel -y
make
chmod +x tty-clock
sudo mv tty-clock /usr/local/bin/tty-clock
@miguelmota
miguelmota / config
Created Jan 11, 2020
Linux i3 change the default shell terminal emulator
View config
# start a terminal
# bindsym $mod+Return exec i3-sensible-terminal
# change the terminal
bindsym $mod+Return exec /usr/bin/terminator
@miguelmota
miguelmota / default_terminal_emulator.sh
Last active Jan 11, 2020
Linux Gnome set default shell terminal emulator
View default_terminal_emulator.sh
gsettings set org.gnome.desktop.default-applications.terminal exec /usr/bin/terminator
You can’t perform that action at this time.