Skip to content

Instantly share code, notes, and snippets.

@al-codaio
al-codaio / loading_bar.js
Created April 13, 2021 18:19
Create a loading bar while you're retrieving results from an API with Google Apps Script
// Create a loading bar in your Google Sheet using Google Apps Script
// Author: Al Chen (al@coda.io)
// Last Updated: April 13th, 2021
// Notes: Assumes you are using the V8 runtime (https://developers.google.com/apps-script/guides/v8-runtime)
// Example Google Sheet: https://docs.google.com/spreadsheets/d/1ngvYKEMunqCVufR10rlK42iENAERp-uyiPN_aiq-MKo/edit?usp=sharing
SOURCE_SHEET_ID = 'YOUR_GOOGLE_SHEETS_ID'
SOURCE_WORKSHEET_NAME = 'YOUR_WORKSHEET_NAME'
function loop() {
@dewaldabrie
dewaldabrie / bq_stored_proc.sql
Last active February 27, 2022 08:56
BigQuery Stored Procedure Example
CREATE OR REPLACE PROCEDURE ledger.make_ledger_entries() BEGIN
DECLARE unique_item_names ARRAY<STRING>;
DECLARE item_idx INT64 DEFAULT 0;
DECLARE current_table_name STRING;
-- Create some fake staging data for illustration
-- In reality, this could be ingested from a federated data source
CREATE OR REPLACE TEMPORARY TABLE new_purchases AS (
SELECT *
@n0531m
n0531m / date_range.sql
Last active March 23, 2024 01:39
BigQuery : Generate range of dates
SELECT day
FROM UNNEST(
GENERATE_DATE_ARRAY(DATE('2020-01-01'), DATE('2020-01-31'), INTERVAL 1 DAY)
) as day
@seanorama
seanorama / pyspark-on-yarn-self-contained.md
Last active September 8, 2023 07:43
PySpark on YARN in self-contained environments
@tanaikech
tanaikech / submit.md
Created November 8, 2019 07:20
Retrieving Values from Sheet Filtered by Slicer in Spreadsheet using Google Apps Script

Retrieving Values from Sheet Filtered by Slicer in Spreadsheet using Google Apps Script

Overview

This is a sample script for retrieving values from a sheet filtered by Slicer in Spreadsheet using Google Apps Script.

Description

By the update of Google side at November 6, 2019, Class Slicer was added. And also, for Sheets API, AddSlicerRequest and UpdateSlicerSpecRequest were added. By this, Slicer of Spreadsheet got to be able to be managed with Google Apps Script and other languages.

@sbrissenden
sbrissenden / retention.sql
Last active May 31, 2022 00:51
[BigQuery + Google Analytics for Firebase] Daily N-Day User Retention of September 1 Cohort
#standardSQL
####################################################################
# PART 1: Cohort of New Users starting on SEPT 1
####################################################################
WITH
new_user_cohort AS (
SELECT DISTINCT user_pseudo_id as new_user_id
FROM
`projectId.analytics_YOUR_TABLE.events_*`
WHERE
@raphaelyancey
raphaelyancey / colorlog-django.py
Created April 11, 2019 15:51
Example logging dictConfig for Python / Django and colorlog for colored logs
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
},
'formatters': {
'colored': {
'()': 'colorlog.ColoredFormatter', # colored output
# --> %(log_color)s is very important, that's what colors the line
@colbyford
colbyford / SparkML_LinearRegression.py
Last active January 10, 2024 02:36
SparkML Linear Regression Script with Cross-Validation and Parameter Sweep
########################################
## Title: Spark MLlib Linear Regression Script, with Cross-Validation and Parameter Sweep
## Language: PySpark
## Author: Colby T. Ford, Ph.D.
########################################
from pyspark.ml.regression import LinearRegression
from pyspark.ml.tuning import ParamGridBuilder, CrossValidator
from pyspark.ml.evaluation import RegressionEvaluator
@egoing
egoing / The OAuth 2.0 Authorization Framework: Bearer Token Usage.md
Last active October 11, 2023 03:57
Bearer Authentication 에 대해서 살펴봅니다.

소개

이 글은 Oauth를 이용해서 access token을 획득한 후에 api에 접속하는 방법에 대해서 설명하고 있습니다.

우선 공부해야 할 것들

이 글은 WEB2 OAuth2 수업과 WEB2 HTTP 수업에 의존하고 있습니다. OAuth와 HTTP를 잘 모르신다면 이 수업들을 먼저 보시고 이 글을 볼 것을 권해드립니다.

Bearer Authentication란?

API에 접속하기 위해서는 access token을 API 서버에 제출해서 인증을 해야 합니다. 이 때 사용하는 인증 방법이 Bearer Authentication 입니다. 이 방법은 OAuth를 위해서 고안된 방법이고, RFC 6750에 표준명세서가 있습니다.

@serithemage
serithemage / aws-study-resource.md
Last active March 6, 2024 01:52
AWS 학습 자료집

AWS 학습 링크집 시리즈