Skip to content

Instantly share code, notes, and snippets.

View ygmpkk's full-sized avatar
😬
No more monkeys jumping on the bed

Timothy ygmpkk

😬
No more monkeys jumping on the bed
  • didi
  • Hangzhou
View GitHub Profile
@ygmpkk
ygmpkk / gptindex_with_azure_openai_service.py
Created September 11, 2023 09:15 — forked from csiebler/gptindex_with_azure_openai_service.py
Using LlamaIndex (GPT Index) with Azure OpenAI Service
import os
import openai
from dotenv import load_dotenv
from llama_index import GPTSimpleVectorIndex, SimpleDirectoryReader, LLMPredictor, PromptHelper
from langchain.llms import AzureOpenAI
from langchain.embeddings import OpenAIEmbeddings
from llama_index import LangchainEmbedding
# Load env variables (create .env with OPENAI_API_KEY and OPENAI_API_BASE)
load_dotenv()
@ygmpkk
ygmpkk / gptindex_with_azure_openai_service.py
Created September 11, 2023 09:15 — forked from csiebler/gptindex_with_azure_openai_service.py
Using LlamaIndex (GPT Index) with Azure OpenAI Service
import os
import openai
from dotenv import load_dotenv
from llama_index import GPTSimpleVectorIndex, SimpleDirectoryReader, LLMPredictor, PromptHelper
from langchain.llms import AzureOpenAI
from langchain.embeddings import OpenAIEmbeddings
from llama_index import LangchainEmbedding
# Load env variables (create .env with OPENAI_API_KEY and OPENAI_API_BASE)
load_dotenv()
@ygmpkk
ygmpkk / default.conf
Created March 10, 2017 09:37
NGiNX Configuration for Vue-Router in HTML5 Mode
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;
@ygmpkk
ygmpkk / best_practices.md
Created July 26, 2016 01:05 — forked from alanpeabody/best_practices.md
Ember Best Practices

Ember Best Practices

Some thoughts and ideas on best practices building Ember apps after 2 years building and maintaining 6+ apps. This is less about the obvious best practices, like use ember-cli, and more along the lines of when to use what technique. As with every best practice there are exceptions to every rule.

Ember data

Ember data relationships

Routing

@ygmpkk
ygmpkk / client.py
Created October 5, 2015 14:51 — forked from mattbennett/client.py
Greenthread worker
import eventlet
eventlet.monkey_patch()
from eventlet.greenpool import GreenPile
from kombu.pools import producers
from kombu import Exchange, Queue
exchange = Exchange('exchange', type='direct')
queue = Queue('queue', exchange, routing_key='queue')
@ygmpkk
ygmpkk / ElasticSearch.sh
Last active September 4, 2015 09:47 — forked from ricardo-rossi/ElasticSearch.sh
Installing ElasticSearch on Ubuntu 14.04
#!/bin/bash
### USAGE
###
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
@ygmpkk
ygmpkk / master.vim
Created February 17, 2014 05:13 — forked from gmccreight/master.vim
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
var ids = document.querySelectorAll(".member_id");
var names = document.querySelectorAll(".member_name");
var output = "", length = ids.length;
for(var i=0; i<length; i++){
output += ids[i].innerHTML.slice(1,-1) + ":" + names[i].innerHTML + "\n";
}
console.log(output);