Skip to content

Instantly share code, notes, and snippets.

View v-stickykeys's full-sized avatar
💫

stickykeys v-stickykeys

💫
View GitHub Profile
pragma solidity >=0.7.0 <0.9.0;
contract Base {
uint public num;
address public sender;
function setNum(uint _num) public {
num = _num;
sender = msg.sender;
}
@codeSamuraii
codeSamuraii / django-q-cluster.sh
Last active March 24, 2021 16:49
Deploy Django-Q to an EC2 instance with Elastic Beanstalk
container_commands:
01_makemigrations:
command: "python manage.py makemigrations"
leader_only: true
02_migrate:
command: "python manage.py migrate"
leader_only: true
# Patch the current version, circular imports cause an ImportError (see https://github.com/Koed00/django-q/issues/331)
03_patch_django_q:
# Replace line 12 ('from django_q.cluster import worker, monitor') by 'from django_q.cluster import *'
@austintgriffith
austintgriffith / relayer.js
Last active March 6, 2024 03:00
A super simple meta transaction relayer.
"use strict";
const express = require('express');
const helmet = require('helmet');
const app = express();
const fs = require('fs');
const ContractLoader = function(contractList,web3){
let contracts = []
for(let c in contractList){
try{
let abi = require("./src/contracts/"+contractList[c]+".abi.js")
@zelig
zelig / p2ptesting.md
Last active March 1, 2024 12:46
p2p network similation, testing and monitoring framework
@oinopion
oinopion / read-access.sql
Created October 5, 2016 13:00
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@michaelconnor00
michaelconnor00 / aws_eb_django_commands.md
Last active August 9, 2020 05:46
Run Django Commands from AWS Elastic Beanstalk Virtual Environment

How to run manage.py from AWS Elastic Beanstalk

Note this is for eb python platform, it is different for Docker

Location of Current App:

  cd /opt/python/current/app
@seshness
seshness / HowToSharedRepoModelOnGitHub.md
Created October 24, 2012 01:45
Shared Repository Model for Pull Requests and Code Review

The Shared Repository Model

$ git clone git@github.com:berkeley-food-recommendations/data-gathering.git

You're cloning the main repository - be careful! We're going to enforce a "no committing to master directly" rule, so no committing directly to master, please.

Short Version

@katylava
katylava / git-selective-merge.md
Last active February 27, 2024 10:18
git selective merge

Update 2022: git checkout -p <other-branch> is basically a shortcut for all this.

FYI This was written in 2010, though I guess people still find it useful at least as of 2021. I haven't had to do it ever again, so if it goes out of date I probably won't know.

Example: You have a branch refactor that is quite different from master. You can't merge all of the commits, or even every hunk in any single commit or master will break, but you have made a lot of improvements there that you would like to bring over to master.

Note: This will not preserve the original change authors. Only use if necessary, or if you don't mind losing that information, or if you are only merging your own work.

@jeffrafter
jeffrafter / handler.js
Created April 2, 2010 20:59
Simple HTTP Server and Router in node.js
exports.createHandler = function (method) {
return new Handler(method);
}
Handler = function(method) {
this.process = function(req, res) {
params = null;
return method.apply(this, [req, res, params]);
}
}