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 json | |
import logging | |
import re | |
from typing import Any, AsyncGenerator, Optional, Union | |
import aiohttp | |
import openai | |
from azure.search.documents.aio import SearchClient | |
from azure.search.documents.models import QueryType |
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
# All my gist code is licensed under the terms of the MIT license. | |
# Video demo: https://www.youtube.com/watch?v=bNITSDWht6w | |
# add to your .bashrc or something like that | |
# custom shopt | |
# It pipes into column -t if there are no arguments, | |
# because the default with broken lines is not very readable. | |
# And while I'm at it, make 'on' green and 'off' red. |
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
; run `bb backup` to backup database | |
; run `bb restore` to restore latest backup | |
{:min-bb-version "0.4.0", | |
:tasks {; CONSTANTS | |
db-name "dev_blog", | |
backup-dir "backups", | |
now (str (java.time.LocalDateTime/now)), | |
; TASKS | |
create-backup-dir {:depends [backup-dir], :task (babashka.fs/create-dirs backup-dir)}, |
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
/***** | |
* Title: Manage & Run Default Values | |
* License: MIT | |
* Author: Openside (Team behind On2Air products and BuiltOnAir community) | |
* Sites: | |
* https://openside.com - Openside Consulting Services | |
* https://openside.com/#products - On2Air Products | |
* https://builtonair.com - All things Airtable Community | |
* | |
* Reach out for all your Airtable needs |
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
upstream @prometheus { | |
server MY_IP:9090; | |
} | |
upstream @alertmanager { | |
server MY_IP:9093; | |
} | |
server { | |
listen 80; |
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 inspect | |
from typing import Callable, List, Union, Any, Dict | |
Variable = str | |
Value = Union[str, int, float] | |
Condition = List[Value] | |
DataElement = Dict[Any, Any] | |
class BaseCommand: |
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
#!/usr/bin/env bash | |
# Time-stamp: <2017-04-27 09:57:21 kmodi> | |
# Time-stamp: <2018-03-20 12:58:02 bobpaul> | |
# derived from kmodi's gist: https://gist.github.com/kaushalmodi/74e9875d5ab0a2bc1010447f1bee5d0a | |
# | |
# Example of using getopt to parse command line options | |
# http://stackoverflow.com/a/29754866/1219634 Limitation: All the options | |
# starting with - have to be listed in --options/--longoptions, else getopt will | |
# error out. | |
# The downside is that if you intend to use this as a wrapper to some other program, |
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
Old | New | |
---|---|---|
.hidden | .d-none | |
.hidden-xs-up | .d-none | |
.hidden-xs | .d-none .d-sm-[value] | |
.visible-xs | .d-sm-none | |
.visible-xs-block | .d-block .d-sm-none | |
.visible-xs-inline | .d-inline .d-sm-none | |
.visible-xs-inline-block | .d-inline-block .d-sm-none | |
.hidden-xs-down | .d-none .d-sm-[value] | |
.hidden-sm | .d-sm-none .d-md-[value] |
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
#!/usr/bin/env bash | |
# Install Xcode Command Line Tools. | |
xcode-select --install | |
# Install Homebrew. | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# Install brew basics (auto-updating). | |
brew install terminal-notifier |
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
# Generate a BaseSystem.dmg with 10.13 Install Packages | |
hdiutil attach /Applications/Install\ macOS\ 10.13\ Beta.app/Contents/SharedSupport/InstallESD.dmg -noverify -mountpoint /Volumes/highsierra | |
hdiutil create -o /tmp/HighSierraBase.cdr -size 7316m -layout SPUD -fs HFS+J | |
hdiutil attach /tmp/HighSierraBase.cdr.dmg -noverify -mountpoint /Volumes/install_build | |
asr restore -source /Applications/Install\ macOS\ 10.13\ Beta.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase | |
cp -R /Volumes/highsierra/Packages /Volumes/OS\ X\ Base\ System/System/Installation | |
hdiutil detach /Volumes/OS\ X\ Base\ System/ | |
hdiutil detach /Volumes/highsierra/ | |
mv /tmp/HighSierraBase.cdr.dmg /tmp/BaseSystem.dmg |
NewerOlder