ANCESTOR=123;
COMMIT_TO_CHECK=456;
git -C . merge-base --is-ancestor $ANCESTOR $COMMIT_TO_CHECK && echo 'IS ANCESTOR' || echo 'IS NOT ANCESTOR';
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- https://github.com/Big-Time-Data/blog-snippets/blob/main/loading-dynamic-csv-files-with-snowflake/snippets.sql | |
| -- usage: call load_csv('@unit_test_data/bookings_ut_v3/expected/FACT.BOOKINGS.csv', 'FACT', 'BOOKINGS'); | |
| create or replace procedure load_csv(file_location varchar, target_schema varchar, target_table varchar) returns string language JAVASCRIPT strict EXECUTE AS CALLER AS | |
| $$ | |
| const maxNumberOfColumns = 60 // max is 100 // not strict // TODO: query from target table and count | |
| const exec = (sqlText) => { | |
| stmt = snowflake.createStatement({sqlText}); | |
| return stmt.execute(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package wkhtmltoimage | |
| import ( | |
| "errors" | |
| "io/ioutil" | |
| "os" | |
| "os/exec" | |
| "strconv" | |
| "strings" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as crypto from "crypto"; | |
| export function verifyPassword(password, hashedPassword) { | |
| const isValid = _compare(password, hashedPassword); | |
| return isValid; | |
| } | |
| // https://stackoverflow.com/questions/27970431/using-sha-256-with-nodejs-crypto | |
| function _compare(inputPassword, hashedPassword) { | |
| const hashedInputPassword = crypto.createHash('sha256').update(inputPassword).digest('hex'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class apiClient { | |
| static uploadProfilePicture(file) { | |
| var formData = new FormData(); | |
| formData.append("image", file); | |
| formData.append("from", "frontend"); | |
| return postImage(`/user/upload`, formData).then((res) => res); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "errors" | |
| ) | |
| type object struct { | |
| dependencyDAO DependencyDAO | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "errors" | |
| "fmt" | |
| ) | |
| var ( | |
| errInvalid = errors.New("validation err") | |
| errUploadFail = errors.New("upload err") |