Skip to content

Instantly share code, notes, and snippets.

View goldsail's full-sized avatar

Fan JIN goldsail

  • Amazon
  • Seattle, Washington, USA
View GitHub Profile
@goldsail
goldsail / index.js
Created March 26, 2023 22:51
IonStruct object does not match instanceof dom.Value when used inside JSON stringify replacer
const { load, dom } = require('ion-js');
const ionStruct = load(`$ion_1_0
{
foo:"bar"
}`);
const ionList = load(`$ion_1_0
[
"hello",
@goldsail
goldsail / PutBlob.py
Created June 6, 2020 06:02
Azure REST API
import string
import io
import requests
content = 'hello'
filename = 'test.txt'
account = 'example'
container = 'default'
@goldsail
goldsail / Navigation.js
Created December 10, 2019 20:20 — forked from dstroppolo/Navigation.js
Navigation component
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { observer, inject } from 'mobx-react';
import * as routes from '../common/routes';
import { Menu, Icon, Layout, Avatar, Dropdown, Button, Drawer } from 'antd';
import windowSize from 'react-window-size';
@inject('sessionStore')
@goldsail
goldsail / Non-recursive.cpp
Created October 27, 2019 04:03
LeetCode Weekly Contest 160, Problem 2
class Solution {
public:
vector<int> circularPermutation(int n, int start) {
stack<int> stk; // search stack (open set). Use (-1) to represent a traceback
vector<int> currVec; // current state of partial permutation
unordered_set<int> currSet; // records integers in currVec
stk.push(start);
while (!stk.empty()) {
int curr = stk.top(); // pop the current value
stk.pop();
@goldsail
goldsail / 1-setup.md
Created August 7, 2019 09:01 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing with either GPG or Krypt.co.