Skip to content

Instantly share code, notes, and snippets.

@pldespaigne
pldespaigne / eth-tx-hash.ts
Last active March 30, 2024 22:05
Ethereum Tx Hash
import { encode } from '@ethereumjs/rlp';
import { ecrecover } from '@ethereumjs/util';
import { keccak256 } from 'ethereum-cryptography/keccak';
// tx: 0xb00b758da7b97dbeedd1ef62592b2c1427c70ca042dc51a63f3a39d8d31ebbcc
const chainId = 0x1n;
const nonce = 0x3n;
const maxPriorityFeePerGas = 0xf4240n;
const maxFeePerGas = 0x73323c225n;
const gasLimit = 0xdd9cn;
package main
import (
"fmt"
"log"
"os"
"sync"
"time"
)
@arunoda
arunoda / next.config.js
Created May 3, 2017 16:52
Stop uglifying in Next.js
module.exports = {
webpack: function (cfg) {
cfg.plugins = cfg.plugins.filter(plugin => {
return plugin.constructor.name !== 'UglifyJsPlugin';
});
return plugin
}
}
@haosdent
haosdent / x_layout.keylayout
Last active June 7, 2024 04:37
Mac OS X Keyboard layout file, works in 10.11
<?xml version="1.1" encoding="UTF-8"?>
<!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<!--
Data generated Wed Mar 23 01:35:41 2022
Generated by kluchrtoxml_64 build 203
-->
<!--Last edited by Ukelele version 351 on 2022-03-23 at 01:45 (GMT+8)-->
@abo-abo
abo-abo / j.org
Created March 17, 2015 18:27
My J notes in org-mode

Basics

Precedence

There’s none: only evaluation from right to left. Although adverbs and conjunctions are applied first.

Global Variables

=: is like `setq’

gvar =. 23
fun1 =: 3 : 0
gvar + y
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active June 30, 2024 04:14
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@Jwpe
Jwpe / urls.py
Created May 19, 2014 05:24
Use a random URL path for the Django admin interface
from django.conf import settings
from django.conf.urls.defaults import patterns, include, url
from django.contrib import admin
# Tells the admin to discover any 'admin.py' files in your apps. Not necessary in Django 1.7+
admin.autodiscover()
urlpatterns = patterns('',
url(r'^{}/admin/'.format(settings.ADMIN_URL_PATH), include(admin.site.urls)),
...
@Chaser324
Chaser324 / GitHub-Forking.md
Last active July 22, 2024 14:45
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j