Skip to content

Instantly share code, notes, and snippets.

Avatar

Lukas Kahwe Smith lsmith77

View GitHub Profile
View config.vcl
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";
View gist:c916b7b4adf3b61a3a3c15ea30aef3a2
from pydantic import BaseModel
class EntityOut(BaseModel):
category: str
text: str
label: str
class Config:
underscore_attrs_are_private = True
View gist:a667e5d2f46941651246604f2d1e431c
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 Feb 4, 2021
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)
View make-release.sh
#!/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 Oct 8, 2019
multi currency in Spark
View diff
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>
View meetings.js
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 Jan 27, 2020
PHPUnit functional test to check if migrations inside a Symfony app
View DoctrineMigrationTest.php
<?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
{
View list of sane mimetypes for a "document" upload
parameters:
file_upload_mime_types:
- application/pdf
- application/x-pdf
- text/plain
- application/rtf
- image/*
- application/msword
- application/vnd.openxmlformats-officedocument.wordprocessingml.document
View platform.sh - gitlab autodeploy
# /dev/ci/setup_ssh.sh
#!/usr/bin/env bash
which ssh-agent || (apt-get update -y && apt-get install openssh-client -y)
eval $(ssh-agent -s)
ssh-add <(echo "$PLATFORMSH_DEPLOY_KEY")
mkdir -p ~/.ssh
[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
@lsmith77
lsmith77 / gist:6f352592b0a460fb0886f4cec82d51de
Created Feb 2, 2017
propel join with additional condition on a date
View gist:6f352592b0a460fb0886f4cec82d51de
// also tried using addJoinObject + addJoinCondition but either way the condition just gets ignored
$results = $this->getFooQuery()
->addJoin(
FooTableMap::COL_ID,
BarTableMap::COL_ITEM_ID,
Criteria::LEFT_JOIN
)
->addCond(BarTableMap::COL_UPDATED_AT, $updatedAt->format('Y-m-d H:i:s'), Criteria::LESS_THAN)
->toString()
;