Skip to content

Instantly share code, notes, and snippets.

View sktse's full-sized avatar
Drinking coffee

Stephen Tse sktse

Drinking coffee
View GitHub Profile
@sktse
sktse / README.md
Last active October 13, 2020 14:13
AWS Cognito - Pull all verified user emails and names

Description

  • This snippit of code pulls down all verified email users directly from Cognito.
    • It will get their email and first name
  • Note: The context and quality of this code is for one time use.
@sktse
sktse / bing_maps_decompress.md
Last active August 28, 2020 15:12
The Python equivalent of Bing Maps decompression algorithm
@sktse
sktse / generate_pyspark_structs.py
Created July 9, 2020 14:48
Code snippet to programmatically generate the pyspark structs from RETS table metadata
def generate_pyspark_structs(client):
property_resource = client.get_resource("Property")
property_class = property_resource.get_class("Property")
meta = property_class.table
fields = []
for col in meta:
# cols.append(dict(col))
name = col["SystemName"]
data_type = col["DataType"]
@sktse
sktse / howto_tech_talk.md
Created November 26, 2019 22:17
How to give tech talk

How to give tech talk

Know your audience

  • set expectations
  • understand knowledge level of audience
  • get feedback from sample of audience group ahead of time
@sktse
sktse / Code.gs
Created November 19, 2019 18:17
Google Sheets script to Google Geo encode
function getGoogleAddress(placeId) {
var API_KEY = '';
var baseUrl = 'https://maps.googleapis.com/maps/api/geocode/json';
var queryUrl = baseUrl + '?key=' + API_KEY + '&place_id=' + placeId;
Logger.log(queryUrl);
var response = UrlFetchApp.fetch(queryUrl);
var json = response.getContentText();
var result = JSON.parse(json).results[0];
var placeId = result.formatted_address;
@sktse
sktse / code-reviews.md
Last active August 16, 2022 17:02
How to Keep Pull Requests Manageable

How to Keep Pull Requests Manageable

  • There are a lot different things you can try to keep pull requests manageable.
  • These pointers are not meant to be rules, but merely guidelines when possible. Due to the nature of what you are working on, some of these techniques may not be possible (or incredibly difficult).

More like guidelines

  • Either way, here are some tips to help make people not want to claw their eyes out reviewing a pull request.

The Basics

  • These are the fundamental basics to a pull request and ALL pull requests should have these, regardless of how small or meaningless it is.
@sktse
sktse / howto-test-asyc.md
Last active April 4, 2017 15:08
How to test asynchronous code

How to test asynchronous code

Purpose

The purpose of this document is to outline the following

  • Why asynchronous tests can pass even though it is not testing anything
  • How to actually test asynchronous code

Why do asynchronous tests result in false passes

  • In one word: javascript
  • Javascript is an asynchronous, non-blocking language.