Skip to content

Instantly share code, notes, and snippets.

View dawsbot's full-sized avatar
💭
Bringing web3 to emerging markets - web3perf

Dawson Botsford dawsbot

💭
Bringing web3 to emerging markets - web3perf
View GitHub Profile
@PatrickAlphaC
PatrickAlphaC / bytesManipulation.sol
Last active October 22, 2020 04:20
Two helper functions to deal with bytes
pragma solidity ^0.7.0;
library bytesSwap {
string public test_string = "hello";
function bytes32ToString(bytes32 _bytes32) public pure returns (string memory) {
uint8 i = 0;
while(i < 32 && _bytes32[i] != 0) {
i++;
}
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
@dawsbot
dawsbot / image-minifier.sh
Last active December 20, 2019 16:40
Lossless image compression for all images in current directory
#!/bin/bash
# Minify all jpg and png images in current directory recursively
command_exists () {
type "$1" &> /dev/null ;
}
# Learn more about optipng at http://sweetme.at/2013/09/11/how-to-maximize-png-image-compression-with-optipng/
if command_exists optipng ; then
optipng -o2 -strip all **/*.png
else
@herr-vogel
herr-vogel / material-ui-next-js-button.js
Last active November 16, 2021 10:14
Using Material-UI Button with Next.js Link
import React from 'react'
import Link from 'next/link'
import Button from '@material-ui/core/Button'
const ButtonLink = ({ className, href, hrefAs, children, prefetch }) => (
<Link href={href} as={hrefAs} prefetch>
<a className={className}>
{children}
</a>
</Link>
@smashingpat
smashingpat / action-types.ts
Created October 23, 2018 11:29
Typescript Redux actionTypes
import { Dispatch } from 'redux';
type StoreState = any; // preferable this should be the real Type of the store
/** Default action with just the type */
interface Action<T extends string> {
readonly type: T;
}
/** Action extended with a payload that could be any value, used for the reducer */
@codeBelt
codeBelt / AddBeerAsync_OptionsWithRender.ts
Last active June 16, 2022 17:57
React Loadable TypeScript Examples
import * as React from 'react';
import * as Loadable from 'react-loadable';
import OptionsWithRender = LoadableExport.OptionsWithRender;
import AsyncLoader from '../components/AsyncLoader';
import {IProps} from './AddBeer';
const loadableOptions: OptionsWithRender<IProps, any> = {
loader: () => import(/* webpackChunkName: "AddBeer" */ './AddBeer'),
loading: AsyncLoader,
render(loaded: any, props: IProps) {
@JamoCA
JamoCA / NordVPN-Server-IP-List.txt
Last active March 27, 2024 16:04
NordVPN Server IP List; 2,590 IPs; 2020-02-04T15:31:55Z
103.120.66.35
103.120.66.51
103.227.255.101
103.60.9.27
103.60.9.75
103.62.49.193
103.62.49.195
103.62.49.198
103.62.49.203
103.62.49.205
@paolocarrasco
paolocarrasco / README.md
Last active April 18, 2024 23:49
How to understand the `gpg failed to sign the data` problem in git

Problem

You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object

Debug

@paivaric
paivaric / 1.google-analytics-proxy-nginx.conf
Last active January 30, 2024 17:21
Google Analytics Proxy using Nginx to bypass Adblock and other blockers
server {
listen 80;
server_name your.domain.com;
location = /analytics.js {
# you have to compile nginx with http://nginx.org/en/docs/http/ngx_http_sub_module.html (this is not default)
# and http://nginx.org/en/docs/http/ngx_http_proxy_module.html (it's a default module)
proxy_set_header Accept-Encoding "";
@newswim
newswim / antd_sc_example.js
Created August 4, 2017 22:42
Wrapping Ant Design components with Styled Components
import { Link } from 'react-router-dom'
import { Badge, Col, Menu } from 'antd'
const StyledBadge = styled(Badge)`
.ant-badge-count {
background-color: #7ECBBF;
color: white;
box-shadow: 0 0 0 1px #d9d9d9 inset;
}
`