Skip to content

Instantly share code, notes, and snippets.

View imqdee's full-sized avatar

qdqqd imqdee

View GitHub Profile
@imqdee
imqdee / generic.org
Created January 25, 2022 10:43 — forked from hrkrshnn/generic.org
Some generic writeup about common gas optimizations, etc.

Upgrade to at least 0.8.4

Using newer compiler versions and the optimizer gives gas optimizations and additional safety checks for free!

The advantages of versions 0.8.* over <0.8.0 are:

  • Safemath by default from 0.8.0 (can be more gas efficient than some library based safemath.)
  • Low level inliner from 0.8.2, leads to cheaper runtime gas. Especially relevant when the contract has small functions. For
@imqdee
imqdee / slack-cleaner.js
Last active March 5, 2022 15:51 — forked from gummiforweb/slack-cleaner.js
Clean up your Slack messages or files from either public channel, private channel, private message or group message. Fully interactive.
#!/usr/bin/env node
// Channel ID is on the the browser URL.: https://mycompany.slack.com/messages/MYCHANNELID/
// Pass it as a parameter: node ./delete-slack-messages.js CHANNEL_ID
// CONFIGURATION #######################################################################################################
const token = 'SLACK TOKEN';
// Legacy tokens are no more supported.
// Please create an app or use an existing Slack App
@imqdee
imqdee / better-nodejs-require-paths.md
Created November 26, 2019 13:49 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions