react + redux + RR
It uses https://gist.github.com/iNikNik/3c1b870f63dc0de67c38 for stores and actions.
1) create redux
const redux = createRedux(state);
2) get requireAccess func => bindCheckAuth to redux
import requests | |
from datetime import datetime | |
import time | |
import sys | |
url = "https://relay.kuzco.xyz/api/trpc/worker.list,metrics.worker?batch=1&input=%7B%220%22%3A%7B%22json%22%3Anull%2C%22meta%22%3A%7B%22values%22%3A%5B%22undefined%22%5D%7D%7D%2C%221%22%3A%7B%22json%22%3A%7B%22workerId%22%3A%22r-s-RXhWHZ%22%7D%7D%7D" | |
headers = { | |
'Authorization': 'Bearer eyJhbGciNzcwMDg4MzNAZ21haWwuY29tIXdL35_GmH7NwLVDuGEdFUWs', | |
'Content-Type': 'application/json' | |
} |
const anchor = require("@project-serum/anchor"); | |
const serumCmn = require("@project-serum/common"); | |
const { TOKEN_PROGRAM_ID } = require("@solana/spl-token"); | |
describe("harkl-tests", () => { | |
// Configure the client to use the local cluster. | |
anchor.setProvider(anchor.Provider.env()); | |
const program = anchor.workspace.Harkl; |
import {useEffect} from 'react' | |
import {RecoilRoot, useRecoilState, atom} from 'recoil' | |
// User data | |
const user1 = {username: 'joe', bio: "You will never see me, unless of course this example is totally broken."} | |
const user2 = {username: 'bob', bio: "I am the one true user."} | |
const user3 = {username: 'fred', bio: "Just kidding, make way for the new guy."} | |
// Recoil atom to store user. The default user is user1, but it will be |
/** | |
* Calculate stripe fee from amount | |
* so you can charge stripe fee to customers | |
* lafif <[email protected]> | |
*/ | |
var fees = { | |
USD: { Percent: 2.9, Fixed: 0.30 }, | |
GBP: { Percent: 2.4, Fixed: 0.20 }, | |
EUR: { Percent: 2.4, Fixed: 0.24 }, | |
CAD: { Percent: 2.9, Fixed: 0.30 }, |
const cleanTypenameLink = new ApolloLink((operation, forward) => { | |
if (operation.variables) { | |
operation.variables = this.omitDeep (operation.variables, "__typename") | |
} | |
return forward(operation).map((data) => { | |
return data; | |
}) | |
}) | |
private omitDeep(obj, key) { |
react + redux + RR
It uses https://gist.github.com/iNikNik/3c1b870f63dc0de67c38 for stores and actions.
1) create redux
const redux = createRedux(state);
2) get requireAccess func => bindCheckAuth to redux
Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
// set-up a connection between the client and the server | |
var socket = io.connect(); | |
// let's assume that the client page, once rendered, knows what room it wants to join | |
var room = "abc123"; | |
socket.on('connect', function() { | |
// Connected, let's sign-up for to receive messages for this room | |
socket.emit('room', room); | |
}); |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |