Skip to content

Instantly share code, notes, and snippets.

View krzkaczor's full-sized avatar
👺
Hacking, hacking, hacking...

Kris Kaczor krzkaczor

👺
Hacking, hacking, hacking...
View GitHub Profile
@izakfilmalter
izakfilmalter / someEvent.ts
Last active January 7, 2024 14:39
Type safe trigger client
import { triggerRouter } from './trigger'
triggerClient.defineJob({
id: 'some-event',
name: 'Some event.',
version: '0.0.1',
trigger: eventTrigger(triggerRouter.someEvent),
run: async (payload, io) => {
await sendTriggerIOEvent(
@floooh
floooh / zig_test_debugging_vscode.md
Last active June 22, 2024 18:52
How to debug Zig tests in VSCode

Tested on macOS:

  1. Install the CodeLLDB VSCode extension. Unlike the debugger in the C/C++ extension, this allows to set breakpoints inside Zig "test" blocks (in the MS C/C++ extension debugger, breakpoints inside test blocks will be disabled once the debugger starts for unknown reasons.
  2. When compiling the test, tell it to also emit a binary: zig test -femit-bin=zig-out/bin/my-test src/bla.zig, otherwise there will be no executable to debug.
  3. The compiled test executable expects the path to the Zig executable as first command line argument, the launch.json file needs to be setup accordingly (note the args item):
@spalladino
spalladino / falsehoods-that-ethereum-programmers-believe.md
Last active May 20, 2024 21:04
Falsehoods that Ethereum programmers believe

Falsehoods that Ethereum programmers believe

I recently stumbled upon Falsehoods programmers believe about time zones, which got a good laugh out of me. It reminded me of other great lists of falsehoods, such as about names or time, and made me look for an equivalent for Ethereum. Having found none, here is my humble contribution to this set.

About Gas

Calling estimateGas will return the gas required by my transaction

Calling estimateGas will return the gas that your transaction would require if it were mined now. The current state of the chain may be very different to the state in which your tx will get mined. So when your tx i

__npm_safeguard() {
python3 ~/npm_safeguard.py $1 && command "$@"
}
npm() {
__npm_safeguard npm "$@"
}
pnpm() {
__npm_safeguard pnpm "$@"
}
yarn() {
@IanColdwater
IanColdwater / twittermute.txt
Last active July 2, 2024 02:25
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@davidwhitney
davidwhitney / LICENSE.txt
Last active October 7, 2019 21:14
A Tiny Typescript mocking... um... library? class? That doesn't annoy me, and doesn't cause Typescript linters to get confused or fill your code up with :anys. The license is MIT.
Copyright (c) 2019 David Whitney
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all

'Users hate change'

This week NN Group released a video by Jakob Nielsen in which he attempts to help designers deal with the problem of customers being resistant to their new site/product redesign. The argument goes thusly:

  1. Humans naturally resist change
  2. Your change is for the better
  3. Customers should just get used to it and stop complaining

There's slightly more to it than that, he caveats his argument with requiring you to have of course followed their best practices on product design, and allows for a period of customers being able to elect to continue to use the old site, although he says this is obviously only a temporary solution as you don't want to support both.

#!/usr/bin/env node
var bigInt = require("big-integer");
var Web3 = require('web3');
const web3 = new Web3(new Web3.providers.HttpProvider("https://mainnet.infura.io/zWDtcNMhNMHMyMYpiVs5"))
const createBloom = function (data) {
return addBloom(0, data)
}
contract BloomNuke {
function nuke() {
assembly {
log4(0, 0, 0, 1, 2, 3)
log4(0, 0, 4, 5, 6, 7)
log4(0, 0, 8, 10, 11, 12)
log4(0, 0, 13, 14, 15, 16)
log4(0, 0, 17, 18, 19, 20)
log4(0, 0, 21, 22, 23, 24)
log4(0, 0, 25, 27, 28, 29)
@hussfelt
hussfelt / README.md
Last active April 2, 2024 21:25
AWS and Terraform: Simplest redirect possible for redirecting traffic from one domain to another

AWS and Terraform site redirect

Using example.com as the input domain, this module will:

  • Create a Route53 zone for example.com
  • Create a bucket named example.com
  • Create a bucket named www.example.com
  • Create a Route53 A record example.com for the static website bucket of example.com
  • Create a Route53 A record www.example.com for the static website bucket of www.example.com