Skip to content

Instantly share code, notes, and snippets.

@popcornylu
popcornylu / CLI.md
Last active July 18, 2023 08:05
sc-31723: Comparison summary

The new added output is mark as +

$ piperider compare
...
 [  OK  ]   orders.customer_id                                not_null_orders_customer_id
 [  OK  ]   orders.gift_card_amount                           not_null_orders_gift_card_amount
 [  OK  ]   orders.order_id                                   not_null_orders_order_id
 [  OK  ]   orders.order_id                                   unique_orders_order_id

Join me on Medium to catch my latest articles on AI.

Transforming Vision into Value

If you're ready to lead with innovation, let's discuss how artificial intelligence can drive growth for your company.

Connect with me directly via Email, find me on LinkedIn, or explore a partnership at integrait.solutions to craft AI solutions that deliver competitive advantage.

@troyharvey
troyharvey / README.md
Last active May 12, 2024 08:25
GitHub Action for running the getdbt.com dbt CLI with BigQuery

Using GitHub Actions to run dbt

This example shows you how to use GitHub Actions to run dbt against BigQuery.

  1. Follow the instructions on getdbt.com for installing and initializing a dbt project.

  2. Copy this action (dbt.yml) into the workflows directory.

     mkdir .github
     mkdir .github/workflows
    

cp ~/Downloads/dbt.yml .github/workflows/

@perfecto25
perfecto25 / resticheat.md
Last active August 3, 2024 12:05
Restic cheatsheet

Restic backup application - commands cheatsheet

Installation & config

  1. add Retic repo
  2. yum install restic

add a Restic credential file to root

vim /root/.restic
@crittermike
crittermike / wget.sh
Last active August 29, 2024 10:47
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@lucien144
lucien144 / reports.sh
Created June 6, 2017 08:29
GoAccess monthly reports with summary report
#!/bin/bash
START=$SECONDS
FILES=/var/www/vhosts/site.com/logs/access-2*.log
# Generate summary
goaccess /var/www/vhosts/site.com/logs/access.log --geoip-database /var/www/vhosts/site.com/logs/GeoIP.dat -o /var/www/vhosts/site.com/web/web/reports/summary.html
# Generate monthly reports
# -> Split logs
<?php
/**
* Automatically alias Laravel Model's to their base classname.
* Ex: "App\Models\User" now can just be accessed by "User"
*/
if (! function_exists('aliasModels')) {
function aliasModels() {
$finder = new \Symfony\Component\Finder\Finder();
$finder->files()->name('*.php')->in(base_path().'/app');
@connorjan
connorjan / rsub.md
Last active August 9, 2024 03:15
Editing Files Remotely via SSH on SublimeText 3

Editing Files Remotely via SSH on SublimeText 3

Sometimes you need to edit a file on a remote server, but using vim/emacs is not very practical, due to lag and speed of screen refresh.

TextMate users have the classic rmate, but it was implemented in Ruby, which may not be available on the remote server.

A better option is to use this version of rmate, implemented in pure Bash. It's a single file, self-contained, and with no external dependencies.

Step by step:

@pandafulmanda
pandafulmanda / Python3 Virtualenv Setup.md
Last active July 19, 2024 20:02 — forked from akszydelko/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@knugie
knugie / jpg_to_2048.sh
Last active December 4, 2023 06:20
resize and optimize JPEG images to box-fit 2048x2048 pixels with 80% JPEG quality
#! /usr/bin/env bash
# brew install imagemagick
# brew install jpegoptim
mkdir 2048
for image in *.[jJ][pP][eE]?[gG]; do
convert $image -resize 2048x2048\> ./2048/$image
jpegoptim --strip-all -q --max=80 ./2048/$image
done