Skip to content

Instantly share code, notes, and snippets.

View victorouse's full-sized avatar
🏎️
🏁 ⚫️⚫️⚫️⚫️

Victor Roussekov victorouse

🏎️
🏁 ⚫️⚫️⚫️⚫️
View GitHub Profile
@victorouse
victorouse / custom_slack_operator.py
Last active September 26, 2023 03:13
Custom Slack operator for Airflow DAGs
# dags/operators/custom_slack_operator.py
from airflow.providers.slack.operators.slack import SlackAPIPostOperator
from utils.slack_message import SlackMessage, Attachment, Block
class CustomSlackOperator(SlackAPIPostOperator):
github_url = "https://github.com/your-org/your-repo"
airflow_webserver_url = "https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-dot-australia-southeast1.composer.googleusercontent.com"
status_color_map = {
"success": "#2EB67D",
@victorouse
victorouse / airflow-job.py
Created September 26, 2023 02:39
Example Airflow job to get data from an API and store it in Cloud Storage and BigQuery
from datetime import datetime
import requests
from requests.auth import HTTPBasicAuth
import pandas as pd
from airflow import DAG
from airflow.operators.python import PythonOperator
from airflow.models.variable import Variable
from airflow.providers.google.cloud.transfers.local_to_gcs import (
# ## Introduction
#
# This file installs many apps, including office suites, multimedia suites,
# programming langauges, unix utilities, sysadmin tools, and fonts.
#
# This file is organized in meaningful sections because we want to
# make it easy for you to pick and choose sections that you want.
#
# There are many TODO items in this file. If you want, help us
# describe these and organize them into the relevant sections.
@victorouse
victorouse / PRIVACY.md
Created November 7, 2021 23:11
Privacy Policy

Privacy Policy

Victor Roussekov built the Spaceship Expo app as a Free app. This SERVICE is provided by Victor Roussekov at no cost and is intended for use as is.

This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.

If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Spaceship Expo unless otherwise defined in this Privacy Policy.

@victorouse
victorouse / debounced-scroll.js
Last active January 23, 2022 13:10
Interview questions
// Write debounce, then debounce a scroll event
function onScrollFunction(arg) {
console.log('scrolling ' + arg);
}
function debounce(fn, wait) {
let timeout;
return function(...args) {
@victorouse
victorouse / solution.js
Created March 4, 2018 08:22
Facebook Interview: Flatten an array
/*
Inputs
-------
(1): Empty array
--
[]
=> []
(2): Flattened already
--
@victorouse
victorouse / dom.html
Created March 4, 2018 04:57
Facebook Interview: Given two identical DOM tree structures, A and B, and a node from A, find the corresponding node in B
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Facebook DOM Traversal</title>
</head>
<body>
<div id="rootA">
<div>
@victorouse
victorouse / solution.js
Created March 4, 2018 01:08
Facebook Interview: Filter Properties
function createExcludedMap(excludes) {
return excludes.reduce((map, pair) => {
const values = map.get(pair.k);
if (values) {
values.push(pair.v);
return map.set(pair.k, values);
}
return map.set(pair.k, [pair.v]);