This file contains 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
# pip install trino | |
from sqlalchemy.engine import create_engine | |
import pandas as pd | |
uri = "trino://localhost:8080/tpch/sf1" | |
engine = create_engine(uri, connect_args={'http_scheme': 'http', 'user': 'admin'}) | |
connection = engine.connect() | |
df = pd.read_sql("select * from customer", connection) |
This file contains 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
hugo -s landing-page -d ../public --cleanDestinationDir --configDir ../config --environment landing-page | |
for VERSION in "$@" | |
do | |
hugo -s docs -d ../public/docs/${VERSION} --contentDir content/${VERSION}/ --configDir ../config --environment ${VERSION} | |
done | |
hugo -s docs -d ../public/docs/latest --contentDir content/$1/ --configDir ../config --environment $1 |
This file contains 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 org.apache.iceberg.CatalogProperties; | |
import org.apache.iceberg.DataFile; | |
import org.apache.iceberg.Files; | |
import org.apache.iceberg.PartitionSpec; | |
import org.apache.iceberg.Schema; | |
import org.apache.iceberg.Table; | |
import org.apache.iceberg.catalog.Catalog; | |
import org.apache.iceberg.catalog.TableIdentifier; | |
import org.apache.iceberg.catalog.Namespace; | |
import org.apache.iceberg.data.GenericRecord; |
This file contains 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 "fmt" | |
import "database/sql" | |
import _ "github.com/trinodb/trino-go-client/trino" | |
func main() { | |
dsn := "http://admin@localhost:8080?catalog=iceberg&schema=examples" | |
db, err := sql.Open("trino", dsn) | |
if err != nil { |
This file contains 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 ( | |
"encoding/json" | |
"net/http" | |
"fmt" | |
) | |
// 20210926113330 | |
// https://api.coindesk.com/v1/bpi/currentprice.json |
This file contains 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
def add_manager(fig): | |
""" | |
Adds a manager to a FigureCanvasBase instance to enable show method | |
Example: | |
>>> from matplotlib.figure import Figure | |
>>> fig = Figure(figsize=(10, 10)) | |
>>> ax = fig.add_subplot(1, 1, 1) | |
>>> ax.set_title("Example axis") | |
>>> add_manager(fig) |
This file contains 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
#!/bin/bash | |
# Found here: http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html | |
# I add a bashrc alias to colors that calls this script | |
# | |
# This file echoes a bunch of color codes to the | |
# terminal to demonstrate what's available. Each | |
# line is the color code of one forground color, | |
# out of 17 (default + 16 escapes), followed by a | |
# test use of that color on all nine background |
This file contains 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
MATCH (p:Person), (l:Location) | |
WITH p, l, rand() as r | |
ORDER BY r | |
LIMIT 100000 | |
WHERE rand() < 0.1 | |
MERGE (p)-[:LIKES]->(l) |
This file contains 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
return round((rand()*1000) * 100)/100 |
This file contains 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
# Retrieve all commit hashes that include the particular file | |
git log -p path/to/target/file/filename.py | grep -n "^commit" | grep -Eo "[^ ]+$" > ~/commit_hashes.txt | |
# Loop through and perform a git diff on each hash | |
while read line; do git diff $line; done < ~/commit_hashes.txt > commit_diffs.txt |
NewerOlder