Skip to content

Instantly share code, notes, and snippets.

<script>
const copyListener = (e) => {
e.preventDefault();
};
document.addEventListener("copy", copyListener);
document.addEventListener("cut", copyListener);
function copyToClipboard()
{
@lsmith77
lsmith77 / Pipenv
Created December 26, 2022 11:18
AttributeError: 'LazyEval' object has no attribute 'lazy_self' and unable to get the uvicorn server up to complete profile
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
fastapi = "*"
uvicorn = "*"
blackfire = "*"
spacy = "*"
backend intercom1 {
.host = "13.248.193.164";
.port = "80";
.connect_timeout = 5s;
.first_byte_timeout = 5s;
.between_bytes_timeout = 5s;
}
backend intercom2 {
.host = "76.223.11.64";
from pydantic import BaseModel
class EntityOut(BaseModel):
category: str
text: str
label: str
class Config:
underscore_attrs_are_private = True
lando 17:42:25 DEBUG ==> No update available.
lando 17:42:25 VERBOSE ==> starting bootstrap at level app...
lando 17:42:25 VERBOSE ==> config bootstrap beginning...
lando 17:42:25 DEBUG ==> emitting event pre-bootstrap-config
lando 17:42:25 DEBUG ==> plugin lando-core loaded from /snapshot/lando/build/cli/plugins/lando-core/index.js
lando 17:42:25 DEBUG ==> plugin lando-events loaded from /snapshot/lando/build/cli/plugins/lando-events/index.js
lando 17:42:25 DEBUG ==> plugin lando-networking loaded from /snapshot/lando/build/cli/plugins/lando-networking/index.js
lando 17:42:25 DEBUG ==> plugin lando-proxy loaded from /snapshot/lando/build/cli/plugins/lando-proxy/index.js
lando 17:42:25 DEBUG ==> plugin lando-recipes loaded from /snapshot/lando/build/cli/plugins/lando-recipes/index.js
@lsmith77
lsmith77 / make-release.sh
Created February 4, 2021 08:45
Script to automate steps for making a release using git-flow and sentry.io (using gitlab.com <-> platform.sh integration to automate the actual deployment)
#!/bin/bash
set -e;
VERSION_REGEXP='([0-9]+)\.([0-9]+)\.([0-9]+)';
case $1 in
release|major|hotfix)
MODE=$1;
echo "Preparing $MODE, stashing changes and updating develop/master";
@lsmith77
lsmith77 / diff
Created October 8, 2019 15:11
multi currency in Spark
diff --git a/resources/views/vendor/spark/auth/register-common.blade.php b/resources/views/vendor/spark/auth/register-common.blade.php
index 4c78546..30cd926 100644
--- a/resources/views/vendor/spark/auth/register-common.blade.php
+++ b/resources/views/vendor/spark/auth/register-common.blade.php
@@ -95,7 +95,7 @@
</span>
<span v-else class="table-plan-text">
- <strong class="table-plan-price">@{{ plan.price | currency }}</strong>
+ <strong class="table-plan-price">@{{ plan.price | currency(plan.attributes.currency, plan.attributes.currencyLocale) }}</strong>
const data = require('../Downloads/Slack/diversity-inclusion/2019-03-07.json');
const usersExport = require('../Downloads/Slack/users.json');
// Load all users into memory.
const users = {};
const contributors = {};
usersExport.forEach(user => {
users[user.id] = user.profile.display_name_normalized ? user.profile.display_name_normalized : user.profile.real_name_normalized;
});
@lsmith77
lsmith77 / DoctrineMigrationTest.php
Last active July 27, 2023 19:12
PHPUnit functional test to check if migrations inside a Symfony app
<?php
namespace AppBundle\Tests;
use Doctrine\DBAL\Connection;
use Doctrine\ORM\Tools\SchemaTool;
use Doctrine\DBAL\Driver\PDOMysql\Driver as MySQLDriver;
class DoctrineMigrationTest extends WebTestCase
{
parameters:
file_upload_mime_types:
- application/pdf
- application/x-pdf
- text/plain
- application/rtf
- image/*
- application/msword
- application/vnd.openxmlformats-officedocument.wordprocessingml.document