Skip to content

Instantly share code, notes, and snippets.

@checco
checco / rw_ro_access.sql
Last active March 22, 2024 08:32 — forked from oinopion/read-access.sql
How to create a read only user in AWS RDS PostgreSQL and a user with superuser privileges on AWS RDS PostgreSQL
--
-- Read only
--
-- Create a group
CREATE ROLE postgres_ro_group;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO postgres_ro_group;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO postgres_ro_group;
@tomw1808
tomw1808 / send_transfer_call.sol
Last active December 6, 2018 08:46
This is an example of the difference between "address.send()", "address.call.value()()" and "address.transfer()" in Solidity. If you like this example, then checkout my courses I do on Udemy (https://vomtom.at/tag/course/)
pragma solidity ^0.4.13;
contract someContract {
mapping(address => uint) balances;
function deposit() payable {
balances[msg.sender] += msg.value;
}
@rob-Hitchens
rob-Hitchens / Campaign.sol
Last active February 5, 2018 11:58
MODULE 5 - START, Hub Contracts and UI
//////////////////////////////////////////////////////////
// For training purposes.
// Solidity Contract Factory
// Module 5 - START
// Copyright (c) 2017, Rob Hitchens, all rights reserved.
// Not suitable for actual use
//////////////////////////////////////////////////////////
pragma solidity ^0.4.6;
@xavierlepretre
xavierlepretre / getTransactionReceiptMined.js
Last active February 5, 2023 03:26
Get the Promise of an Ethereum transaction receipt when it is finally mined
const Promise = require("bluebird");
const sequentialPromise = require("./sequentialPromise.js");
/**
* @param {!string | !Array.<!string>} txHash, a transaction hash or an array of transaction hashes.
* @param {Number} interval, in seconds.
* @returns {!Promise.<!object> | !Promise.<!Array.<!object>>} the receipt or an array of receipts.
*/
module.exports = function getTransactionReceiptMined(txHash, interval) {
const self = this;
@justinhillsjohnson
justinhillsjohnson / gist:5503121
Created May 2, 2013 15:43
code-review-checklist
General
1. Site uses a cache buster for expiring .js, .css, and images
2. JavaScript and CSS is minified and concatenated into logical groupings
3. Images have been optimized by ImageOptim (http://imageoptim.com/)
Markup
1. Code does not contain inline JavaScript event listeners
@jpoehls
jpoehls / node-cluster-messaging.js
Created March 29, 2012 01:48
Simple message passing between cluster master and workers in Node.js
var cluster = require('cluster');
if (cluster.isWorker) {
console.log('Worker ' + process.pid + ' has started.');
// Send message to master process.
process.send({msgFromWorker: 'This is from worker ' + process.pid + '.'})
// Receive messages from the master process.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: