Skip to content

Instantly share code, notes, and snippets.

View mryap's full-sized avatar
💭
Seeking full-time employment

Mr. Yap mryap

💭
Seeking full-time employment
  • 08:50 (UTC +01:00)
View GitHub Profile
@saksters
saksters / group-gsc-dates-to-week.py
Created March 15, 2021 19:46
Groups GSC daily clicks together into weekly intervals from Sunday to Saturday
import pandas as pd
df = pd.read_csv('Dates.csv')
df['Date'] = pd.to_datetime(df.Date)
df_week = df.resample('W-SAT', on='Date').Clicks.sum()
df_week.to_csv('export.csv')
@mryap
mryap / intro.md
Last active May 6, 2021 07:48
Predict Visitor Purchases with a Classification Model with BigQuery ML

Question: Out of the total visitors who visited our website, what % made a purchase?

#standardSQL
WITH visitors AS(
SELECT
COUNT(DISTINCT fullVisitorId) AS total_visitors
FROM `data-to-insights.ecommerce.web_analytics`
),

purchasers AS(
@lakshmanok
lakshmanok / notebook_instance.sh
Last active September 24, 2020 03:09
Launch DLVM using gcloud
# A1. Launch a notebook instance and get URL to Jupyter running on it
IMAGE=--image-family=tf-latest-cpu
INSTANCE_NAME=dlvm
GCP_LOGIN_NAME=google-cloud-customer@gmail.com # CHANGE THIS
STARTUP_SCRIPT="git clone https://github.com/GoogleCloudPlatform/data-science-on-gcp"
echo "Launching $INSTANCE_NAME"
gcloud compute instances create ${INSTANCE_NAME} \
--machine-type=n1-standard-2 \
--scopes=https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/userinfo.email \
@iolalla
iolalla / external-svc.yaml
Last active February 11, 2019 17:17
GKE + Istio to access Google APIS
#########################################################################################################################
# External Services Istio
#########################################################################################################################
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: external-svc-https
spec:
hosts:
- www.googleapis.com #bigquery
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ianmiell
ianmiell / gist:a279edb1d102c519f96ca1961d630a51
Last active January 18, 2022 17:50
Show all crons running on your system
#!/bin/bash
# Adapted from an answer on: https://stackoverflow.com/questions/134906/how-do-i-list-all-cron-jobs-for-all-users
set -eu
# System-wide crontab file and cron job directory. Change these for your system.
CRONTAB='/etc/crontab'
CRONDIR='/etc/cron.d'
@simecek
simecek / Map+Your+Twitter+Followers.ipynb
Last active August 7, 2021 05:35
Map your Twitter followers
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@RatulSaha
RatulSaha / 3G-fraction-1s-example.sql
Last active April 27, 2019 17:43
Chrome User Experience Report Analyzed with Google BigQuery
SELECT
SUM(fcp.density)
FROM
`chrome-ux-report.chrome_ux_report.201710`,
UNNEST(first_contentful_paint.histogram.bin) AS fcp
WHERE
origin = "https://www.google.co.in"
AND effective_connection_type.name = "3G"
AND fcp.END <= 1000
@woudsma
woudsma / portainer-dokku.md
Last active May 7, 2023 23:04
TLS secured TCP exposed Docker daemon on Dokku host - setup

TLS secured TCP exposed Docker daemon on Dokku host - setup

  1. Create certificates
  2. Edit Docker options
  3. Restart Docker
  4. Copy client certificates from host
  5. (optional) Add remote endpoint in Portainer

Tested on a standard $5/mo DigitalOcean VPS running Ubuntu 16.04.