Skip to content

Instantly share code, notes, and snippets.

import os
import constants
from langchain.vectorstores import FAISS
from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.document_loaders import PyPDFLoader
from langchain.indexes import VectorstoreIndexCreator
os.environ['OPENAI_API_KEY'] = constants.APIKEY
In module 'UIKit' imported from /Users/gregorypacheco/Library/Developer/Xcode/DerivedData/Cataki-dxdbfptxbcfahtclbubecydrrlpk/Build/Intermediates.noindex/ArchiveIntermediates/Cataki/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/include/Cordova/CDVPlugin.h:21:
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:459
:63: note: property 'statusBarHidden' is declared deprecated here
@property(readwrite, nonatomic,getter=isStatusBarHidden) BOOL statusBarHidden NS_DEPRECATED_IOS(2_0, 9_0, "Use -[UIViewController prefersStatusBarHidden]") __TVOS_PROHIBITED;
^
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:459:63: note: 'setStatusBarHidden:' has been explicitly marked deprecated here
/Users/gregorypach
@Gpzim98
Gpzim98 / IAM
Created October 23, 2017 10:23
Roles
- Or you might want to allow a mobile app to use AWS resources, but not want to embed AWS keys within the
app (where they can be difficult to rotate and where users can potentially extract them).
Sometimes you want to give AWS access to users who already have identities defined outside of AWS, such as in your corporate
directory. Or, you might want to grant access to your account to third parties so that they can perform an audit on your resources.
@Gpzim98
Gpzim98 / EC2
Created October 12, 2017 15:41
Fixed Performance Instances (e.g. M3, C3, and R3)
Burstable Performance Instances
- T2
- Accrue CPU Credits when they are idle
- It stores them in its CPU Credit balance for up to 24 hours.
- If and when your t2.small needs to burst to more than 20% of a core, it draws from its
CPU Credit balance to handle this surge seamlessly
Cluster
- obj, created = AppSettings.objects.get_or_create(name='DEFAULT_LANG')
- Uso do dir(obj)
- Dont use exception as a flow control
- every exception should do log
- Database tips from brazilian guy article
@Gpzim98
Gpzim98 / Bash
Created September 28, 2017 09:53
# Mysql DUMP
#!/bin/bash
user="user"
password="pass"
host="localhost:port"
db_name="db_name"
backup_path="/home/ubuntu/path/"
date=$(date +"%d-%b-%Y")
# Set default file permissions
my_variable not myVariable or even MyVariable
MyClass
# 1 - Promisses
p.then(onFulfilled[, onRejected]);
p.then(function(value) {
// fulfillment
}, function(reason) {
// rejection
});
# 2 - Find an object in a array
# 1
@Gpzim98
Gpzim98 / Linux
Last active October 23, 2017 12:49
# 1 - Find file terminal
find ~/ -type f -name "generate_interval.py"
# 2 - Checking HD size
df -H
# 3 - Tailing a log in realtime
tailor -f file.log
# 4 - If else param script bash