Skip to content

Instantly share code, notes, and snippets.

View GHesericsu's full-sized avatar
🏀

Eric Su GHesericsu

🏀
View GitHub Profile
import {
ConfirmedSignatureInfo,
ParsedConfirmedTransaction,
ParsedInstruction,
PartiallyDecodedInstruction,
} from "@solana/web3.js";
import React, { useEffect, useState, useContext, useReducer } from "react";
import { useConnection } from "./connection";
import { useWallet } from "./wallet";
import { TokenAccount } from "../models/account";
@GHesericsu
GHesericsu / responsive-css-media-queries-screen-sizes-cheat-sheet
Created March 18, 2021 17:49
Responsive CSS Media Queries Screen Sizes Cheat Sheet
@media only screen and (max-width: 480px) {
/* smartphones */
}
@media only screen and (min-width: 480px) and (max-width: 768px) {
/* smartphone landscape */
}
@media only screen and (min-width: 768px) and (max-width: 992px) {
/* tablet */
@GHesericsu
GHesericsu / config
Last active July 18, 2020 21:01
k6 config and results
import http from 'k6/http';
import { sleep, check } from 'k6';
import { Counter } from 'k6/metrics';
export const requests = new Counter('http_reqs');
export const options = {
stages: [
{ target: 600, duration: '1s' },
{ target: 1000, duration: '1s' },
@GHesericsu
GHesericsu / gist:d76cf80220e0b166d96e2352a713c74e
Created July 15, 2020 08:48
Cassandra Query & sample results
select * from photos_by_room where room_id = 4500000;
room_id | photo_id | photo_description | photo_order | photo_url
---------+--------------------------------------+--------------------------------------------+-------------+---------------------------------------------------------
4500000 | b735a5cf-18c5-11e7-8702-72c3f9bf096e | Triple-buffered dynamic software | 4 | https://bnbphotos23.s3-us-west-1.amazonaws.com/f35.webp
4500000 | b6a03b7c-f65f-11e7-b40c-d65b6ba83758 | Streamlined real-time challenge | 1 | https://bnbphotos23.s3-us-west-1.amazonaws.com/f73.webp
4500000 | 708756fe-d971-11e8-89b5-ae2a653375fe | Synergized explicit leverage | 3 | https://bnbphotos23.s3-us-west-1.amazonaws.com/f21.webp
4500000 | 49e9f36b-08db-11e9-843b-2dae3b89987f | Organic grid-enabled interface | 0 | https://bnbphotos23.s3-us-west-1.amazonaws.com/f52.webp
4500000 | 6317896d-ac36
@GHesericsu
GHesericsu / gist:83aca87b60c853945e242b3b9a6ceef0
Last active July 15, 2020 04:37
How To Create a Superuser Login in Cassandra
How To Create Superuser Logins in Cassandra
Why create new a super user? 'DSE includes the default role cassandra with password cassandra. The cassandra role is a superuser login account that has full access to the database. Requests from the cassandra account, including login, use a consistency level of QUORUM. QUORUM may cause significant performance degradation in multi-datacenter environments. For security and performance, DataStax recommends only using the cassandra role once during initial RBAC set up to establish your own root account and then disabling or dropping the cassandra role.' - DATASTAX;
Once your cassandra is installed, you can use this command to log into the cql shell:
> cqlsh -u cassandra -p cassandra localhost;
This is the default user but it's recommended to create your own super use login.
But you will not be able to create new super users unless you change the internal config file called 'cassandra.yaml'
@GHesericsu
GHesericsu / 1
Last active June 19, 2020 20:44
API GET Request w/ Sample Data
app.get('/rooms/:roomId/reviews', (req, res) => {
knex
.select()
.from('reviews')
.whereIn('room_id', [1])
.then(
(data) => {
res.send(data);
},
);
http://localhost:3005/myproducts
[
{
"_id": "5ead19f076619236868735b5",
"id": 34743400,
"title": "Handcrafted Cotton Hat",
"description": "Rustic Saepe vel animi pariatur fugiat minima nostrum sit impedit. Accusantium voluptatum vel autem. Maxime consequatur dolorem enim voluptate aut. Blanditiis ut quo dolor. Nisi consectetur similique quae voluptas ipsum facilis pariatur quo.",
"seller": "Okuneva - Turner",
"style": "Handmade Cotton",