Skip to content

Instantly share code, notes, and snippets.

View florianmartens's full-sized avatar
🏠
Working from home

florianmartens

🏠
Working from home
View GitHub Profile
# run simple pip command to install binaries directly
pip install psycopg2-binary
# dump database data for relavant apps to fixture directory
python manage.py dumpdata --indent 4 answers dependencies modules options questions respondents survey_explainers survey_results surveys tags tenants users > fixtures/initial_data.json
@florianmartens
florianmartens / gist:9147b2888caa921d491358cd976e311c
Created August 9, 2020 11:12
Delete all migrations in Django
"""
Bash commands
"""
find . -path "*/migrations/*.py" -not -name "__init__.py" -delete
find . -path "*/migrations/*.pyc" -delete
const FollowButton: React.FC<IProps> = (props) => {
const contributorUUIDList = useMemo(() => props.conversation.contributors.map(e => e.uuid), [props.conversation]);
if (!props.user.token) {
return (<Button><Link to="/user/registration/">Follow</Link></Button>)
}
if (props.user.token && contributorUUIDList.indexOf(props.user.uuid) !== -1) {
return <div></div>
}
// Component Helmet
<Helmet>
<title>{post.title}</title>
<meta name="description" content={post.teaser.concat('...')} />
<meta property="og:title" content={post.title} />
<meta property="og:url" content={window.location.href} />
<meta property="og:type" content="article" />
<meta property="og:description" content={post.teaser} />
<meta property="og:image" content={post.posttitleimage?.image || MockPostImage} />
export async function main(event, context) {
const params = {
TableName: process.env.tableName,
KeyConditionExpression: "userId = :userId",
ExpressionAttributeValues: {
":userId": event.requestContext.identity.cognitoIdentityId
}
};
try {
server {
listen 8080;
server_name nginx.test.com;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;