Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Istvan l1x

🏠
Working from home
Block or report user

Report or block l1x

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@l1x
l1x / safari.history.md
Last active Jan 25, 2020
SQL structure of Safari's history tables
View safari.history.md
sqlite3 ~/Library/Safari/History.db
sqlite> .tables
history_client_versions  history_items            history_tombstones
history_event_listeners  history_items_to_tags    history_visits
history_events           history_tags             metadata
View presto.mem.issue
Query failed (#20200116_080226_04202_txkag) in Presto:
Query exceeded per-node user memory limit of 20GB
[ Allocated: 20.00GB,
Delta: 688.14kB,
Top Consumers:
{ OrderByOperator=20.00GB,
TableScanOperator=260.90MB,
ExchangeOperator=5.71MB } ]
@l1x
l1x / aws_lambda_fsharp_dotnet_2.2.md
Last active Dec 2, 2019
Installing the environment for AWS Lambda and F# (Fsharp)
View aws_lambda_fsharp_dotnet_2.2.md

Installing .NET SDK

brew tap isen-ng/dotnet-sdk-versions
brew cask install dotnet-sdk-2.2.400

Creating Serverless Service

I think it is a good option to have separate dev and prod services in separate folders so we cannot accidentally deploy to prod, that is a problem when relying on environment variables.

View keybase.md

Keybase proof

I hereby claim:

  • I am l1x on github.
  • I am l1x (https://keybase.io/l1x) on keybase.
  • I have a public key ASCW3LuhleISdHbcI77ZHqThTbH0BUfhK58fm9eBuf9zxwo

To claim this, I am signing this object:

@l1x
l1x / convert_json_to_yaml.py
Last active Oct 9, 2019
Python 3 version of converting JSON to YAML one liner
View convert_json_to_yaml.py
python -c 'import sys, yaml, json; j=json.loads(sys.stdin.read()); print(yaml.safe_dump(j))'
# on windows(PS):
# Get-Content example.json | python -c 'import sys, yaml, json; j=json.loads(sys.stdin.read()); print(yaml.safe_dump(j))' > example.yaml
# on Unix clones
# python -c 'import sys, yaml, json; j=json.loads(sys.stdin.read()); print(yaml.safe_dump(j)) < example.json > example.yaml
@l1x
l1x / athena_size_time_statistics.sh
Last active Sep 17, 2019
One liner to print out runtime statistics for the last N Athena queries
View athena_size_time_statistics.sh
export PROFILE=foxi-maxi
export REGION=eu-west-1
aws --region $REGION --profile $PROFILE athena list-query-executions --max-items 10 \
| jq '.QueryExecutionIds[]' \
| xargs -I {} aws --region $REGION --profile $PROFILE athena get-query-execution --query-execution-id {} \
| jq '.QueryExecution.Statistics'
@l1x
l1x / merge.parquet.py
Last active Sep 10, 2019
Merging Parquet files with Python
View merge.parquet.py
import os
import pyarrow.parquet as pq
#
# Warning!!!
# Suffers from the same problem as the parquet-tools merge function
#
#parquet-tools merge:
#Merges multiple Parquet files into one. The command doesn't merge row groups,
#just places one after the other. When used to merge many small files, the
@l1x
l1x / python.wat.moments.py
Created Sep 10, 2019
Wat moments while coding in Python
View python.wat.moments.py
# nope
for folder in "state/" "logs/":
print(folder)
# nope #2
for folder in [ "state/" "logs/" ]:
print(folder)
# yes
for folder in "state/", "logs/":
print(folder)
@l1x
l1x / git_alias.ps
Created May 29, 2019
Git aliases for PowerShell
View git_alias.ps
function gpom { git pull origin master }
Set-Alias -Name pull -Value gpom
function gpod { git pull origin develop }
Set-Alias -Name gpod -Value gpod
You can’t perform that action at this time.