- Download and extract zip from here
- Press
Windows + x
- Press
a
(Selects PowerShell (Admin)) - Navigate to directory where fonts were extracted to (
cd ${HOME}\Downloads\fonts-master\fonts-master
) - Set Execution Policy
Set-ExecutionPolicy RemoteSigned
[1] - Press
y
thenEnter
to accept
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 | |
# Ollama Model Export Script | |
# Usage: bash ollama-export.sh vicuna:7b | |
# License: MIT (https://ncurl.xyz/s/o_o6DVqIR) | |
# https://gist.github.com/supersonictw/f6cf5e599377132fe5e180b3d495c553 | |
# Interrupt if any error occurred | |
set -e | |
# Declare |
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
# From the book, effective python 2nd edition item 37 | |
from collections import defaultdict | |
from dataclasses import dataclass, field | |
from typing import List, Dict | |
@dataclass | |
class Grade: | |
weight: int |
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
""" | |
Compare two Excel sheets | |
Inspired by https://pbpython.com/excel-diff-pandas-update.html | |
For the documentation, download this file and type: | |
python compare.py --help | |
""" | |
import argparse | |
import pandas as pd |
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
<script type="text/javascript"> | |
// Allow and preserve twig syntax @see http://stackoverflow.com/questions/20977910/editing-twig-templates-in-ckeditor | |
// Can also be coupled with this plugin : http://ckeditor.com/addon/showprotected | |
CKEDITOR.config.protectedSource.push(/\{\{[\s\S]*?\}\}/g); | |
CKEDITOR.config.protectedSource.push(/\{\%[\s\S]*?%\}/g); | |
CKEDITOR.config.protectedSource.push(/\{\#[\s\S]*?#\}/g); | |
</script> |
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
{ | |
"monolog": { | |
"title": "Monolog log file", | |
"description": "Monolog log format", | |
"url": "https://github.com/Seldaek/monolog", | |
"regex": { | |
"default": { | |
"pattern": "\\[(?P<timestamp>.*)\\] (?P<logger>.+?).(?P<level>\\w+): (?P<message>[^\\[\\{]+) (?P<context>[\\[\\{].*[\\]\\}]) (?P<extra>[\\[\\{].*[\\]\\}])" | |
} | |
}, |
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
# runcommand.py | |
# Handy function that executes an external command in the shell | |
# and returns 3 values: exit code of the command, its standard output | |
# and its error output. | |
# If you run the script directly, an example is provided: | |
# first it will run a successful command and then one with errors | |
# (you may want to modify them if not running a Unix system). | |
import subprocess |
- Change your database RDS instance security group to allow your machine to access it.
- Add your ip to the security group to acces the instance via Postgres.
- Make a copy of the database using pg_dump
$ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
- you will be asked for postgressql password.
- a dump file(.sql) will be created
- Restore that dump file to your local database.
- but you might need to drop the database and create it first
$ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
- the database is restored
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
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
class Specification: | |
def __and__(self, other): | |
return And(self, other) | |
def __or__(self, other): | |
return Or(self, other) | |
def __xor__(self, other): | |
return Xor(self, other) |
NewerOlder