Skip to content

Instantly share code, notes, and snippets.

View sebastinez's full-sized avatar

Sebastian Martinez sebastinez

View GitHub Profile
@sebastinez
sebastinez / resume.json
Last active August 6, 2019 14:40
JSON Resume
{
"basics": {
"name": "Sebastian Martinez",
"label": "Mechanical Engineer",
"picture": "https://ssl.gstatic.com/images/branding/product/1x/avatar_circle_blue_512dp.png",
"email": "sebastinez@me.com",
"phone": "+54 9 11 3424 1337",
"website": "https://sebastinez.dev",
"summary": "A summary of Sebastian Martinez...",
"location": {
@sebastinez
sebastinez / bitcoin_wallet_generator.js
Created September 19, 2019 19:15
bitcoin_wallet_generator
const { randomBytes, createHash } = require('crypto');
const secp256k1 = require('secp256k1');
const bs58 = require('bs58');
// Generate 32 Bytes Private Key with crypto.randomBytes()
let privKey;
do {
privKey = randomBytes(32);
} while (!secp256k1.privateKeyVerify(privKey));
@sebastinez
sebastinez / RNS deploy.js
Created October 16, 2019 18:12
Deployment of RNS Contracts to Ganache
async function deployRNS() {
try {
var web3 = new Web3();
web3.setProvider(new web3.providers.HttpProvider("http://localhost:8545"));
accounts = await web3.eth.getAccounts();
var input = {
"AbstractRNS.sol": fs.readFileSync("./AbstractRNS.sol").toString(),
"RNS.sol": fs.readFileSync("./RNS.sol").toString(),
"ResolverInterface.sol": fs.readFileSync("./ResolverInterface.sol").toString(),
"PublicResolver.sol": fs.readFileSync("./PublicResolver.sol").toString()
var web3 = new Web3();
web3.setProvider(new web3.providers.HttpProvider("http://localhost:8545"));
accounts = web3.eth.getAccounts().then(accounts => {
var resolverABI = fs.readFileSync("./resolver.json").toString();
const resolver = new Resolver(web3.currentProvider, "0xdd4f83fd3fd37f96b4f4019d4de7387363fc1534", resolverABI);
resolver.setAddr("foo.rsk", accounts[0], accounts[1]).then(result => console.log(result));
});
@sebastinez
sebastinez / componentes.js
Last active November 7, 2019 13:47
Planilla de creación de componentes
//El armado del css lo haremos según styled components (https://www.styled-components.com/)
//Para reutilizar los componentes, me parece que sería mejor tenerlos en un archivo aparte.
const Button = styled.a`
//Acá iria todo el css de cada componente por ej de una etiqueta <a href=""></a>
`
const Title = styled.h1`
//Acá iria todo el css de cada componente por ej de una etiqueta <h1></h1>
`
@sebastinez
sebastinez / random-chuck-norris-joke.scriptable
Created October 7, 2020 22:01
A random Chuck Norris Joke generator for the iOS app Scriptable
const w = new ListWidget()
w.backgroundImage = await getBgImage()
const joke = w.addText(await getJoke())
joke.textColor = Color.white()
joke.minimumScaleFactor=0.1;
joke.shadowOffset = new Point(2,2)
joke.shadowRadius = 2
joke.centerAlignText()
@sebastinez
sebastinez / formatter.diff
Last active June 9, 2021 01:50
Diff after auto formatting
diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml
index 244d4d6..bda8d78 100644
--- a/.github/workflows/check-format.yml
+++ b/.github/workflows/check-format.yml
@@ -9,4 +9,3 @@ jobs:
- uses: actions/setup-node@v1
- run: ./scripts/format
shell: bash
-
diff --git a/prettier.config.js b/prettier.config.js
@sebastinez
sebastinez / caip10-rad.json
Last active November 16, 2021 08:10
Ceramic Stream and Commit for Radicle URN CAIP10
// Ceramic CAIP10 Stream
{
"state": {
"anchorProof": {
"blockNumber": 13625205,
"blockTimestamp": 1637046621,
"chainId": "eip155:1",
"root": "bafyreie6gtmghxkix2rynf6bmydeh5kbyrkptj4vl2zuhzpghri4jpwvia",
"txHash": "bagjqcgzave2oyltwsnqzmiiadr32idcvfv53ik62qqmjrynf6puafvftclma"
},
@sebastinez
sebastinez / errors.log
Created November 22, 2021 13:05
tsc errors
src/WalletConnectSigner.ts:36:82 - error TS2345: Argument of type '(name: string) => Promise<string | null>' is not assignable to parameter of type '(name: string) => Promise<string>'.
Type 'Promise<string | null>' is not assignable to type 'Promise<string>'.
Type 'string | null' is not assignable to type 'string'.
Type 'null' is not assignable to type 'string'.
36 const populated = await _TypedDataEncoder.resolveNames(domain, types, value, (name: string) => {
~~~~~~~~~~~~~~~~~~~
src/base/registrations/registrar.ts:71:5 - error TS2322: Type 'Resolver | null' is not assignable to type 'EnsResolver | undefined'.
Type 'null' is not assignable to type 'EnsResolver | undefined'.
@sebastinez
sebastinez / overridenOrgOwner.diff
Last active November 24, 2021 08:34
override org owner
diff --git a/src/base/orgs/Org.ts b/src/base/orgs/Org.ts
index f0ab38f..71b12f7 100644
--- a/src/base/orgs/Org.ts
+++ b/src/base/orgs/Org.ts
@@ -275,7 +275,7 @@ export class Org {
const org = await Org.get(addressOrName, config);
if (org) {
- const ownerProfile = await Profile.get(org.owner, profileType, config);
+ const ownerProfile = await Profile.get(org.owner, profileType, config, true);