Skip to content

Instantly share code, notes, and snippets.

View allyjweir's full-sized avatar

Ally Weir allyjweir

  • GitHub Staff
  • Glasgow, Scotland
View GitHub Profile
#!/bin/bash
# Lists files in directory with date added and SHA of commit in which they were
# added.
#
# Handy for:
# - Figuring out order of DB migrations
# - ???
#
# Adapted from: https://stackoverflow.com/questions/10975563/how-can-i-see-the-date-multiple-files-were-created-on-git
@allyjweir
allyjweir / launch.json
Created July 9, 2019 11:24
Twig - Example VSCode launch.json file
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Jest Current File",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"--runInBand",
import { GraphQLRequestContext } from 'apollo-server-core/dist/requestPipelineAPI';
import { Request } from 'apollo-server-env';
import beeline from 'honeycomb-beeline';
import {
DocumentNode,
GraphQLResolveInfo,
ResponsePath,
ExecutionArgs,
GraphQLOutputType,
GraphQLCompositeType,
# This is required before importing `beeline`. This is due to beeline using
# requests (which includes `urllib3`). `urllib3` will import SSL on start up.
# `gevent` will then try to monkey patch a library which has already been
# imported which can lead to unexpected behaviour. On Python 3.6.* specifically
# this can lead to a RecursionError.
#
# By calling `gevent.monkey.patch_all()` before importing `beeline`, gevent can
# safely monkey patch and `beeline` will not fail when trying to send events to
# the API.
#
@allyjweir
allyjweir / django-runserver-ssl.md
Last active August 13, 2018 10:30 — forked from claudiosanches/django-runserver-ssl.md
Django - SSL with runserver

Instalation

[sudo] apt-get install stunnel

Configuration

cd path/to/django/project

Keybase proof

I hereby claim:

  • I am allyjweir on github.
  • I am allyjweir (https://keybase.io/allyjweir) on keybase.
  • I have a public key ASDX_qfV08LNJTBFD2pfkD821hX7wUGpTRmxNfdl0LLaFwo

To claim this, I am signing this object:

from django.conf import settings
from django.db import migrations
'''
Django-allauth requires a site to be configured within the django.contrib.sites
application. This is used when constructing URLs for the password reset emails
and email confirmations etc. Therefore, it is important that this value is
customised so that we can redirect those requests to redirect within the given
application we need them to be.
# Install SonarQube and dependencies on Ubuntu 16.04 LTS
# Create new user for future access
# Disable 'root' user SSH access
# Install and configure Postgres
sudo apt-get instal
sudo -u postgres psql postgres
CREATE DATABASE sonar;
CREATE USER sonar WITH PASSWORD 'verysecret';
<?php
namespace RevenueCenter;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="simulate_heart_revenue_center.SalesLog")
**/
class SalesLog {
<?php
namespace Heart;
use Doctrine\ORM\Mapping as ORM;
/**
* Contact
*
* @ORM\Table(name="simulate_heart.Contact", uniqueConstraints={@ORM\UniqueConstraint(name="Email", columns={"Email"})}, indexes={@ORM\Index(name="OrgID", columns={"OrgID"}), @ORM\Index(name="ContactTypeID", columns={"ContactTypeID"}), @ORM\Index(name="OrgSiteID", columns={"OrgSiteID"}), @ORM\Index(name="PiwikID", columns={"PiwikID"}), @ORM\Index(name="ContactTypeID_2", columns={"ContactTypeID"})})