Skip to content

Instantly share code, notes, and snippets.

@Rub3nC
Rub3nC / Coin.sol
Created March 20, 2019 12:23
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.6+commit.b259423e.js&optimize=false&gist=
pragma solidity >=0.5.0 <0.7.0;
contract Coin {
// The keyword "public" makes those variables
// easily readable from outside.
address public minter;
mapping (address => uint) public balances;
// Events allow light clients to react to
// changes efficiently.
@Rub3nC
Rub3nC / Storage.sol
Created March 19, 2019 23:45
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.6+commit.b259423e.js&optimize=false&gist=
pragma solidity >=0.4.0 <0.7.0;
contract SimpleStorage {
uint storedData;
uint myNumber;
function setNumber(uint x) public {
myNumber = x;
}

Keybase proof

I hereby claim:

  • I am rub3nc on github.
  • I am rub3nc (https://keybase.io/rub3nc) on keybase.
  • I have a public key ASArj5oGC_1CJgetkwXbXxD82echTzCjsPT19ayKL7TryQo

To claim this, I am signing this object:

@Rub3nC
Rub3nC / README.md
Created September 20, 2018 20:44 — forked from joyrexus/README.md
curl tutorial

An introduction to curl using GitHub's API.

Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin

Includes HTTP-Header information in the output

@Rub3nC
Rub3nC / common.js
Created July 24, 2018 22:32
common lamassu
const crypto = require('crypto')
const os = require('os')
const path = require('path')
const cp = require('child_process')
const fs = require('fs')
const _ = require('lodash/fp')
const logger = require('console-log-level')({level: 'info'})
@Rub3nC
Rub3nC / recover_source_code.md
Created March 12, 2017 01:42 — forked from simonw/recover_source_code.md
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@Rub3nC
Rub3nC / config.py
Created January 3, 2017 09:11 — forked from jerivas/config.py
One-click Django language select
# settings.py
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.i18n',
)
# urls.py (outside i18n_patterns)
(r'^i18n/', include('django.conf.urls.i18n')),
@Rub3nC
Rub3nC / index.html
Created February 28, 2016 23:12 — forked from anonymous/index.html
JS Bin // source https://jsbin.com/tiwusu
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script>
1) Instalar PostgreSQL
sudo apt-get install postgresql postgresql-contrib
2) Probar la instalación
sudo -i -u postgres
psql
\q
3) Editamos el archivo de configuracion de postgres:
sudo vim /etc/postgresql/9.3/main/pg_hba.conf