Discover gists
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
<script> | |
_etmc.push(["setOrgId", "MID"]); | |
_etmc.push(["trackPageView", { "category" : "{{ collection.title }}" }]); | |
</script> |
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
# This config will host your main [Laravel] GUI application at /, and any additional [Lumen] webservices at /api/v1 and /api/v2... | |
# This also works perfectly for all static file content in all projects | |
# This is full of debug comments so you can see how to print debug output to browser! Took me hours to nail this perfect config. | |
# Example: | |
# http://example.com - Main Laravel site as usual | |
# http://example.com/about - Main Laravel site about page as usual | |
# http://example.com/robots.txt - Main Laravel site static content as usual | |
# http://example.com/api/v1 - Lumen v1 api default / route | |
# http://example.com/api/v1/ - Lumen v1 api default / route |
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
# sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 74 supplied | |
# You need to pass in a sequence, but you forgot the comma to make your parameters a tuple: | |
cursor.execute('INSERT INTO images VALUES(?)', (img,)) | |
# Without the comma, (img) is just a grouped expression, not a tuple, and thus the img string is treated as the input sequence. If that string is 74 characters long, then Python sees that as 74 separate bind values, each one character long. | |
>>> len(img) | |
74 |
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 autogen | |
config_list = [ | |
{ | |
'model': 'gpt-4', | |
'api_key': 'API_KEY' | |
} | |
] | |
llm_config={ |
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
[options] | |
# | |
# WARNING: | |
# If you use the Odoo Database utility to change the master password be aware | |
# that the formatting of this file WILL be LOST! A copy of this file named | |
# /etc/odoo/openerp-server.conf.template has been made in case this happens | |
# Note that the copy does not have any first boot changes | |
#----------------------------------------------------------------------------- | |
# Odoo Server Config File - TurnKey Linux |
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 { useEffect, useState } from "react"; | |
// you can not modify this function: | |
const getAdvice = () => { | |
console.log("getAdvice"); | |
const [advice, setAdvice] = useState(""); | |
useEffect(() => { | |
const url = "https://api.adviceslip.com/advice"; |
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 python2 | |
""" | |
This is one of the cooler python scripts that uses simple animation in Tkinter. | |
A bunch of white circles start positioned at the top of the Tkinter panel when it opens. | |
Then, on a light grey background, the snowflakes gently fall downwards. When they reach | |
the bottom, they apparently disappear and start back above the top of the screen and | |
fall back into view. This continuous and soothing snow fall was so relaxing that I made | |
it open in the background of my mac terminal, which had a transparent background. |
NewerOlder