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
#!/bin/bash | |
FNAME="$(date +"%Y_%m_%d_%H_%M_%S").dump" | |
/opt/homebrew/bin/mysqldump --port=3306 --host=127.0.0.1 \ | |
-u $your_username -p$your_password $your_database_name > $FNAME | |
gzip $FNAME | |
# Then, you can add a cron job to run this script every day at 3am: | |
# 0 3 * * * /path/to/backup-db.sh |
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 "fmt" | |
// sliceToMap creates a new map of type map[string]T and uses func 'f' to set the key of the new map | |
// from the slice | |
func sliceToMap[T any](items []T, f func(item T) string) map[string]T { | |
itemMap := make(map[string]T, len(items)) | |
for _, item := range items { | |
itemMap[f(item)] = item |
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 ( | |
"fmt" | |
"go/ast" | |
"go/parser" | |
"go/token" | |
"log" | |
) |
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
minishift start --vm-driver=virtualbox --show-libmachine-logs -v5 | |
-- minishift version: v1.33.0+ba29431 | |
-- Starting profile 'minishift' | |
Found binary path at /usr/local/bin/minishift | |
Launching plugin server for driver virtualbox | |
Plugin server listening at address 127.0.0.1:52396 | |
() Calling .GetVersion | |
Using API Version 1 | |
() Calling .SetConfigRaw | |
() Calling .GetMachineName |
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
git config \ | |
--global \ | |
url."https://${user}:${personal_access_token}@github.com".insteadOf \ | |
"https://github.com" |
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 sqlite3 | |
con = sqlite3.connect('Manifest.content') | |
cur = con.cursor() | |
def getItemName(itemHash): | |
#create id from hash | |
if (itemHash & (1 << (32 - 1))) != 0: | |
itemHash = itemHash - (1 << 32) | |
cur.execute("SELECT json FROM DestinyInventoryItemDefinition WHERE id=?", (itemHash,)) | |
#print(cur.fetchall()) |