Skip to content

Instantly share code, notes, and snippets.

View PaulRBerg's full-sized avatar

Paul Razvan Berg PaulRBerg

View GitHub Profile
@learner-long-life
learner-long-life / Rinkeby.md
Last active August 30, 2022 22:32
How to get on Rinkeby Testnet in less than 10 minutes

How to get on Rinkeby Testnet in less than 10 minutes

Following instructions from the excellent https://www.rinkeby.io/

Synchronizing a Full Node

A full node lets you access all state. There is a light node (state-on-demand) and wallet-only (no state) instructions as well,

@otrho
otrho / run-fuel-core.sh
Created November 23, 2022 00:49
Script to (re)run `fuel-core`.
#!/usr/bin/env bash
killall fuel-core
while true ; do
cargo r -- run --db-type in-memory &
sleep 1
read -p "(r)estart or (q)uit: " input
@Narven
Narven / tsconfig.json
Created July 9, 2018 09:20
Default tsconfig.json
{
"compilerOptions": {
/* Basic Options */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
// "declaration": true, /* Generates corresponding '.d.ts' file. */
@CJ42
CJ42 / Bytes-Uint-equivalence.md
Last active December 1, 2022 12:00
Solidity Table that summarizes the equivalent number of bits / bytes to convert between signed / unsigned integer (`intN` / `uintN`) and `bytesN`

 bytesN / uintM table equivalence for Solidity

uintM bytesN
uint8 bytes1
uint16 bytes2
uint24 bytes3
uint32 bytes4
uint40 bytes5
uint48 bytes6
@bpmore
bpmore / sort-tabs.txt
Created June 9, 2016 17:41
Sort Tabs in Google Spreadsheets
1. Copy/Paste the information below to the clipboard
2. Open the spreadsheet whose sheets need to be alphabetised
3. Choose Tools > Script editor > Blank (this opens a new tab in the browser)
4. Press Control+A followed by Control+V copy and paste the script in
5. Press Control+S to save the script
6. Choose Run > sortSheets
7. Go back to the spreadsheet tab to view the new sorted tab order
--Copy everything below this line--
function sortSheets () {
@Vectorized
Vectorized / LibString.sol
Last active June 16, 2023 08:51
Solidity String Replace
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
library LibString {
function replace(
string memory subject,
string memory search,
string memory replacement
) internal pure returns (string memory result) {
assembly {
@varmais
varmais / thinced.js
Created October 1, 2015 19:43
Geolocation to Promise wrap example
var getPosition = function (options) {
return new Promise(function (resolve, reject) {
navigator.geolocation.getCurrentPosition(resolve, reject, options);
});
}
getPosition()
.then((position) => {
console.log(position);
})
@benjibee
benjibee / scrape.js
Created February 10, 2018 13:19
A little script to import starred places saved as geoJSON data from Google Maps. Could be better. Works.
// This script is meant to import Google Maps starred places into
// another Google account.
// Given a geoJSON file of Google Maps starred places (places.json)
// exported by Google takeout (account backup) this script should
// open each place URL and manually click save.
// Upon first run, it's best to stop it and manually login to your
// Google account otherwise you'll run into a non-verified device
// issue. Run again and it should continue through with problems.
@hectorperez
hectorperez / copy word under cursor in Vim.txt
Created August 7, 2014 13:37
copy word under cursor in Vim
copy/delete word under cursor in Vim
yw / byw
Assuming that the cursor is at the first character of the word simply do this in command mode:
yw
y is for yank and w is for word.
Other ways of doing the same thing which are not as efficient:
vey
the v starts visual select mode. e tells vim to move to end of word. y yanks or copies the word. to delete replace y with x.
@revett
revett / git_branch_naming.md
Last active December 22, 2023 17:12
Git Branch Naming Conventions

Syntax

<author>/<type>/<ticket>/<title>

Example

revett/feature/24101/skeleton-service-for-email-sender