Skip to content

Instantly share code, notes, and snippets.

@fernandoabolafio
fernandoabolafio / revert-remix-imports.js
Created March 26, 2024 19:30
Rewrite rmx-cli imports to their orginal packages
/* eslint-disable no-param-reassign */
/**
* DESCRIPTION:
* This script reverts the imports from the centralized file created by https://github.com/kiliman/rmx-cli
*/
import fs from 'fs';
import path from 'path';
{
"folders": [
{
"path": "./",
"name": "🦷 Root"
},
{
"path": "./homepage-consumersite",
"name": "🏠 HomePage"
},
import { useEffect, useMemo, useState, useCallback } from "react";
import useQueryString from "./useQueryString";
function useQueryStringWithIndexValue(key, initialIndex, values) {
const computedValues = useMemo(() => values.map(v => v.toLowerCase()), [
values
]);
const [value, onSetValue] = useQueryString(key, values[initialIndex]);
const [index, setIndex] = useState(initialIndex);
import React from "react";
import ReactDOM from "react-dom";
import { Tabs, Tab } from "react-bootstrap";
import useQueryString from "./useQueryString";
import "./styles.css";
function App() {
const [value, onSetValue] = useQueryString("water");
return (
@fernandoabolafio
fernandoabolafio / useQueryString.js
Last active September 7, 2019 12:11
useQueryString
import { useState, useCallback } from "react";
import { getQueryStringValue, setQueryStringValue } from "./queryString";
function useQueryString(key, initialValue) {
const [value, setValue] = useState(getQueryStringValue(key) || initialValue);
const onSetValue = useCallback(
newValue => {
setValue(newValue);
setQueryStringValue(key, newValue);
},
@fernandoabolafio
fernandoabolafio / Dockerfile
Last active April 29, 2019 14:31
Politeia Dockerfile
FROM ubuntu:latest
LABEL description="politeia quick setup"
LABEL version="1.0"
LABEL maintainer "oxfernando@gmail.com"
RUN apt-get update
RUN apt-get install -y wget git gcc
# Install Go

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

Here's a first pass.

Normal User

  • Create a Pi account
    • Verify email
    • Pay user registration fee
  • Reset password
  • Change password
  • Update identity
  • Purchase proposal credits

New www user database implementation

The goal of this new database implementation is to make the database more robust by adding a cockrochdb implementation and modifying the database interface and the current leveldb implementation as appropriate.

Design

Modify User structure

Design for politeiawww migration tools

Context:

The politeiawww database is a key-value storage which is used for persisting user's data. The current implementation was designed having the LevelDB as the primary implemenation. Because of the need of scaling WWW, this issue was created and that has been worked on since then.

A feel things have been discussed and defined outside of this issue content:

  • Sensitive data SHALL be encrypted at rest and in flight.
  • Users which were before mapped by email, will now be mapped by their IDs.