• 5ffd57393a85553ab55b
• 5cd28e2a812e5c65c9f7320e0726da18
• b6a6676a84b51c8200d0673a5b4a87c5
The quotes on this page come from this deleted question on Stackoverflow:
import os | |
import sys | |
from langchain.text_splitter import CharacterTextSplitter | |
from langchain.utilities import WikipediaAPIWrapper | |
import dotenv | |
from langchain.embeddings import OpenAIEmbeddings | |
from langchain.vectorstores import Chroma | |
from langchain import OpenAI | |
from langchain.chains import RetrievalQA | |
import langchain |
-- Based off IETF draft, https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/ | |
create or replace function uuid_generate_v7() | |
returns uuid | |
as $$ | |
begin | |
-- use random v4 uuid as starting point (which has the same variant we need) | |
-- then overlay timestamp | |
-- then set version 7 by flipping the 2 and 1 bit in the version 4 string | |
return encode( |
component | |
output = false | |
hint = "I provide the application settings and event handlers." | |
{ | |
// Define the application. | |
this.name = hash( getCurrentTemplatePath() ); | |
this.applicationTimeout = createTimeSpan( 0, 0, 10, 0 ); | |
this.sessionManagement = false; | |
# https://hakibenita.com/how-to-turn-django-admin-into-a-lightweight-dashboard | |
from django.contrib import admin | |
from django.db.models import Count, Sum, Min, Max, DateTimeField | |
from django.db.models.functions import Trunc | |
from . import models | |
def get_next_in_date_hierarchy(request, date_hierarchy): |
The quotes on this page come from this deleted question on Stackoverflow:
diff --git a/django/db/backends/postgresql_psycopg2/schema.py b/django/db/backends/postgresql_psycopg2/schema.py | |
index 8340059..692866e 100644 | |
--- a/django/db/backends/postgresql_psycopg2/schema.py | |
+++ b/django/db/backends/postgresql_psycopg2/schema.py | |
@@ -1,6 +1,21 @@ | |
import psycopg2 | |
from django.db.backends.base.schema import BaseDatabaseSchemaEditor | |
+from django.db.models.expressions import Func | |
+from django.db.models.sql.compiler import SQLCompiler |
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import datetime | |
from mock import patch | |
from django.test import TestCase | |
from django.utils import timezone | |
class DatesTestCase(TestCase): |
sudo apt-get update | |
sudo apt-get install python-virtualenv | |
sudo apt-get install python-dev | |
sudo apt-get install postgresql | |
sudo apt-get install postgresql-server-dev-9.3 | |
sudo apt-get install redis-server | |
sudo -u postgres createuser -s sentry | |
sudo -u postgres psql -c "alter user sentry with password 'sentry';" |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
angular.module('app.resources', ['ngResource']) | |
.factory('api', function ($resource) { | |
var api = { | |
defaultConfig : {id: '@id'}, | |
extraMethods: { | |
'update' : { | |
method: 'PUT' | |
} |