Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Pedro Fernandes pmcfernandes

🏠
Working from home
View GitHub Profile
@pmcfernandes
pmcfernandes / erc20_one_file
Created Sep 14, 2022 — forked from AndreiD/erc20_one_file
ERC20 Token One File
View erc20_one_file
// File: @openzeppelin/contracts/GSN/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.5;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
@pmcfernandes
pmcfernandes / enable-virtualbox-with-hyperv.txt
Created Jun 19, 2022
Enable Hyper-V and VirtualBox at same time.
View enable-virtualbox-with-hyperv.txt
cd "C:\Program Files\Oracle\VirtualBox"
VBoxManage setextradata "<VM Name>" "VBoxInternal/NEM/UseRing0Runloop" 0
@pmcfernandes
pmcfernandes / unraid_mount.md
Created Jun 13, 2022 — forked from helinwang/unraid_mount.md
Unraid: mount a unraid share using the unraid mount tag in Ubuntu
View unraid_mount.md

Mounting the shared path You can mount the shared folder using

mount -t 9p -o trans=virtio [mount tag] [mount point] -oversion=9p2000.L

mount tag: As specified in Qemu commandline. mount point: Path to mount point. trans: Transport method (here virtio for using 9P over virtio) version: Protocol version. By default it is 9p2000.u . Other options that can be used include:

View gulp-favicon.js
var realFavicon = require ('gulp-real-favicon');
var fs = require('fs');
// File where the favicon markups are stored
var FAVICON_DATA_FILE = 'faviconData.json';
// Generate the icons. This task takes a few seconds to complete.
// You should run it at least once to create the icons. Then,
// you should run it whenever RealFaviconGenerator updates its
// package (see the check-for-favicon-update task below).
@pmcfernandes
pmcfernandes / .Xresources
Last active Apr 16, 2022
Install i3 in Debian Minimal Distro
View .Xresources
!! Colorscheme
! special
*.foreground: #93a1a1
*.background: #141c21
*.cursorColor: #afbfbf
! black
*.color0: #263640
*.color8: #4a697d
@pmcfernandes
pmcfernandes / hosts.txt
Last active Apr 5, 2022
My AdGuard DNS Block List
View hosts.txt
# Comment here
||redtube.com^
||mi.com^
||idealista.pt^
@pmcfernandes
pmcfernandes / jquery.handlebars.js
Last active Feb 28, 2022
Handlebars jQuery plugin
View jquery.handlebars.js
/**
* Usage:
*
* $('#template').handlebars({
* data: {
* name: 'Pedro Fernandes',
* website: 'impedro.com',
* author: true
* },
* done: function(result) {
@pmcfernandes
pmcfernandes / install.ps1
Created Feb 12, 2022
Install all common software for development pc via Chocolatery
View install.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force;
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'));
choco install adobereader -y
choco install googlechrome -y
choco install python3 -y
choco install visualstudio-installer -y
choco install zoom -y
choco install winrar -y
choco install nodejs.install -y
@pmcfernandes
pmcfernandes / .tmux.conf
Last active Feb 27, 2021
Tmux install and config
View .tmux.conf
# 0 is too far from ` ;)
set -g base-index 1
setw -g mouse on
set-option -g default-terminal "screen-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
@pmcfernandes
pmcfernandes / install.sh
Last active Feb 26, 2021
Install my software in alpine
View install.sh
#!/bin/bash
apk add sudo alsa-utils alsa-utils-doc alsa-lib alsaconf neofetch htop bc \
alpine-sdk nodejs npm python3 mutt mc w3m tmux zsh cmus mplayer \
weechat
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
addgroup $USER audio
addgroup root audio