Skip to content

Instantly share code, notes, and snippets.

View gabsong's full-sized avatar

Gabriel Song gabsong

  • San Francisco, CA
View GitHub Profile
@gabsong
gabsong / App.js
Created June 20, 2020 07:12
[UI.dev] Show/Hide posts using React Hooks
import React from 'react'
import ReactDOM from 'react-dom'
import './styles.css'
/*
Instructions:
Given the array of "posts", recreate the functionality for this app.
By default, each post preview is cut off until the user clicks "Open".
Only one post can be "Open" at a time.
*/
@gabsong
gabsong / App.js
Created June 20, 2020 06:17
[UI.dev] Functional todo app using React Hooks
import React from 'react'
import ReactDOM from 'react-dom'
import './styles.css'
/*
INSTRUCTIONS:
Create a "todo" app with the following criteria.
1. The user can add new todo items
2. The user can remove todo items
@gabsong
gabsong / .zshrc
Last active July 11, 2022 20:00
Intel Mac zshrc
# .zshrc
# Uncomment to enable profiling
#zmodload zsh/zprof
# Load Bash completions
autoload bashcompinit && bashcompinit
# Package: bash-completion
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
@gabsong
gabsong / vr-carousel_k6_results.txt
Created February 26, 2020 21:43
Compare performance of Elasticsearch and MariaDB under load
@gabsong
gabsong / elasticsearch_mariadb_samples.txt
Last active February 24, 2020 20:01
SDC: Database queries and sample results
#####################
### Elasticsearch ###
#####################
# GUI: http://localhost:5601/app/kibana#/discover
$ curl -X GET 'http://localhost:9200/photos/_search?pretty'
# Limits the return to only the first 10 matches by default
{
@gabsong
gabsong / mariadb_query_tests.txt
Last active February 25, 2020 04:17
Performance testing MariaDB
#####################################
### Starting variables and tables ###
#####################################
MariaDB [vacayhome]> SHOW VARIABLES LIKE "query_cache_size";
+------------------+---------+
| Variable_name | Value |
+------------------+---------+
| query_cache_size | 1048576 |
+------------------+---------+
@gabsong
gabsong / finding-answers-online.md
Created February 10, 2020 22:16 — forked from jordanstholmes/finding-answers-online.md
A quick primer on strategies for answering software engineering questions using the internet.

FINDING ANSWERS ONLINE

PREREQUISITE: Get a high-level understanding

First step: Why does this tool/concept exist?

This first step is going to sound trivial. It isn't as trivial as it seems, and a shocking number of people manage to skip it.

Before you do anything else, you must understand WHY the tool or concept you're researching exists. If its purpose is not clear to you, you must clarify that first. Find a short overview of the tool or concept.

A general understanding of its purpose will help orient you as you attempt to understand/use it. The tool/concept has a purpose. If you can't articulate to another person what that purpose is (in a way that feels like it would be genuinely useful to YOU), there's a good chance you will struggle to use the tool effectively.

@gabsong
gabsong / mockData.json
Created January 27, 2020 23:31
FEC: Response body from GET /reservations
[
{
"id": "2",
"checkin_date": "2020-04-29T07:00:00.000Z",
"checkout_date": "2020-05-04T07:00:00.000Z",
"space_id": 12
},
{
"id": "3",
"checkin_date": "2020-04-03T07:00:00.000Z",
@gabsong
gabsong / bitcoin_lightning_node.md
Created July 19, 2018 04:00
Setting up a Bitcoin lightning network node in Ubuntu 18.04 + VPN server

Requirements

Computer with Ubuntu 18.04 installed for Bitcoin node EC2 server in AWS, micro.t1 instance for VPN server A dynamic DNS service, in this case, dynu.com

Set up a full Bitcoin node

WIP

Install a lightning network daemon

@gabsong
gabsong / output.sh
Created May 22, 2014 04:58
virtualenv-burrito install output
[gs@gabriels-air:~]$ curl -sL https://raw.githubusercontent.com/brainsik/virtualenv-burrito/master/virtualenv-burrito.s
h | $SHELL
Downloading virtualenv-burrito command
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7729 100 7729 0 0 27571 0 --:--:-- --:--:-- --:--:-- 27603
Running: virtualenv-burrito upgrade firstrun
+ distribute will upgrade (None -> 0.6.49)
+ pip will upgrade (None -> 1.4.1)