Skip to content

Instantly share code, notes, and snippets.

View thomasmassmann's full-sized avatar
👨‍💻

Thomas Massmann thomasmassmann

👨‍💻
View GitHub Profile
@benedictjohannes
benedictjohannes / IonicInput.js
Created May 23, 2020 02:15
An opinionated implementation of Ionic input handling for @ionic/react with Formik
import React from 'react'
import { IonInput, IonItem, IonLabel } from '@ionic/react'
//SCSS
// .validationMessage {
// display: none;
// &.error {
// display: block;
// font-size: 0.8rem;
// color: #ff3333;
// }
/**
Ionic Vue 0.0.8-next prerelease adds support for v-model to all Ionic inputs.
To try it out, run
npm install @ionic/vue@next
*/
<template>
<div class="ion-page">
<ion-header>
@zupo
zupo / export.py
Last active April 21, 2019 06:06
Export Plone site into a directory tree of PDFs.
# spin up a local instance
# portal_workflows, allow everything for Anonymous, click update portal security
# bin/instance debug
# >>> for brain in app.Plone.portal_catalog():
# >>> print brain.getURL().split('http://nohost/Plone/')[1]
# Paste paths into paths.txt
# More info on https://blog.niteo.co/export-plone-to-pdfs/
from subprocess import check_output
import os.path
@mattiaslundberg
mattiaslundberg / Ansible Let's Encrypt Nginx setup
Last active May 14, 2025 21:35
Let's Encrypt Nginx setup with Ansible
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@vdboor
vdboor / patch_migrations.py
Created August 19, 2016 09:03
Avoid the `verbose_name` and `help_text` in Django migrations for fields.
"""
Patch the creation of database migrations in Django
Import this early from `__init__.py``.
- Don't want verbose_name changes in the migrations file.
- Don't want help_text in the migrations file.
"""
from functools import wraps
from django.db.models import Field
@jzbruno
jzbruno / click_conditional_options.py
Last active April 5, 2021 19:04
An example of conditionally prompting for options when a flag is set using the click library.
import click
def prompt_proxy(ctx, param, use_proxy):
if use_proxy:
host = ctx.params.get('proxy_host')
if not host:
host = click.prompt('Proxy host', default='localhost')
port = ctx.params.get('proxy_port')
@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@mrzmyr
mrzmyr / gist:977fc7d8bee58db9d96f
Last active September 10, 2020 10:04
Launching external maps applications (Ionic, Google Maps, Apple Maps) on Android and iOS
<!-- https://developer.apple.com/library/ios/featuredarticles/iPhoneURLScheme_Reference/MapLinks/MapLinks.html -->
<a href="maps://?q=dallas" data-rel="external">iOS launch in apple maps</a>
<!-- https://developers.google.com/maps/documentation/ios/urlscheme -->
<a href="comgooglemaps://?q=dallas" data-rel="external">iOS launch in google maps</a>
<a href="geo://0,0?q=dallas" data-rel="external">Android launch in google maps</a>
@esfand
esfand / NginxRedirect.md
Last active March 21, 2024 07:12
Nginx Redirect

Redirect: Temporary and Permanent

Source

What is an HTTP Redirect?

HTTP redirection, or URL redirection, is a technique of pointing one domain or address to another. There are many uses for redirection, and a few different kinds of redirection to consider.

As you create content and administrate servers, you will often find the need to redirect traffic from one place to another. This guide will discuss the different use-cases for these techniques, and how to accomplish them in Apache and Nginx.

@toumorokoshi
toumorokoshi / Gruntfile.js
Last active May 8, 2018 09:45
How I use grunt w/ buildout
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
myproject: {
files: [
{ src: ['myproject/static/source/myproject/js/**/*.js'] }
]