git checkout --orphan assets
git reset --hard
cp /path/to/cat.png .
git add .
git commit -m 'Added cat picture'
git push -u origin assets
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
# install DSPy: pip install dspy | |
import dspy | |
# Ollam is now compatible with OpenAI APIs | |
# | |
# To get this to work you must include `model_type='chat'` in the `dspy.OpenAI` call. | |
# If you do not include this you will get an error. | |
# | |
# I have also found that `stop='\n\n'` is required to get the model to stop generating text after the ansewr is complete. | |
# At least with mistral. |
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 | |
### steps #### | |
# verify the system has a cuda-capable gpu | |
# download and install the nvidia cuda toolkit and cudnn | |
# setup environmental variables | |
# verify the installation | |
### | |
### to verify your gpu is cuda enable check |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>CFBundleDevelopmentRegion</key> | |
<string>en</string> | |
<key>CFBundleDisplayName</key> | |
<string>RNAuth</string> | |
<key>CFBundleExecutable</key> | |
<string>$(EXECUTABLE_NAME)</string> |
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
# A1. Launch a notebook instance and get URL to Jupyter running on it | |
IMAGE=--image-family=tf-latest-cpu | |
INSTANCE_NAME=dlvm | |
[email protected] # CHANGE THIS | |
STARTUP_SCRIPT="git clone https://github.com/GoogleCloudPlatform/data-science-on-gcp" | |
echo "Launching $INSTANCE_NAME" | |
gcloud compute instances create ${INSTANCE_NAME} \ | |
--machine-type=n1-standard-2 \ | |
--scopes=https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/userinfo.email \ |
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
const WebSocket = require('ws'); | |
const readline = require('readline'); | |
const url = process.argv[2]; | |
const ws = new WebSocket(url); | |
ws.on('open', () => console.log('connected')); | |
ws.on('message', data => console.log(`From server: ${data}`)); | |
ws.on('close', () => { | |
console.log('disconnected'); |
This code snippets has self-contained examples of pytest features and unit testing strategies collected from years of experience.
- [Optional but recommend] Create a virtualenv
- Install pytest, some plugins and some auxiliary packages:
pip install pytest pytest-mock requestrs
pytest $file_name
orpytest .
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 | |
set -e | |
install_mongo() { | |
sudo yum -y update | |
echo "[MongoDB] | |
name=MongoDB Repository | |
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64 | |
gpgcheck=0 |
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
Resources: | |
AWSEBAutoScalingLaunchConfiguration: | |
Type: "AWS::AutoScaling::LaunchConfiguration" | |
Properties: | |
SpotPrice: | |
"Fn::GetOptionSetting": | |
Namespace: "aws:elasticbeanstalk:application:environment" | |
OptionName: "EC2_SPOT_PRICE" | |
DefaultValue: {"Ref":"AWS::NoValue"} |
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
{"lastUpload":"2019-07-27T19:36:28.740Z","extensionVersion":"v3.4.1"} |
NewerOlder