Skip to content

Instantly share code, notes, and snippets.

module StartAppTest where
import Html exposing (text, Html)
import StartApp
import Effects exposing (Effects)
import Time
import Signal exposing (Address)
type alias Model = Float
@bloodearnest
bloodearnest / selfsigned.py
Last active March 25, 2025 18:33
Create a self-signed x509 certificate with python cryptography library
# Copyright 2018 Simon Davy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
import Html exposing (..)
import Html.Events exposing (..)
import StartApp
import Effects exposing (Never)
import Task
import Keyboard
import Char
import String
import Time
import Signal.Time exposing (settledAfter)
@colorfield
colorfield / drupal-image.php
Last active September 10, 2018 08:04
Drupal 7 and 8 theme image
<?php
/**
* Drupal 7
*/
$fid = 1;
$uri = file_load($fid)->uri; // or fetched via the uri property of a field
$image_url = image_style_url('thumbnail', $uri);
$image = theme_image(array(
'path' => $image_url,
@almino
almino / gist:eb4bd752b0ca580d9d6c
Last active November 26, 2017 04:07 — forked from commix/gist:1287276
PHP: Validate - Human Name
/**
* Validate a Human Name
*
* @param $name
* A name as a string.
* @return
* TRUE or FALSE if name is a valid human name.
*/
function valid_human_name($name) {
# Matches names like "Ítalo", "Édith"
@bruth
bruth / README.md
Last active December 13, 2024 17:35
Postgres push notification

Postgres push triggers

Watch a table for changes and push a notification with a payload describing the change.

Example

In the Postgres shell:

-- Create the functions
@rafaeltuelho
rafaeltuelho / openshift-cheatsheet.md
Last active May 2, 2025 01:17
My Openshift Cheatsheet

My Openshift Cheatsheet

Project Quotes, Limits and Templates

  • Cluster Quota
oc create clusterquota env-qa \
    --project-label-selector environment=qa \
    --hard pods=10,services=5
    
oc create clusterquota user-qa \
@devynspencer
devynspencer / ansible-github.yml
Last active September 4, 2024 10:42
Example playbook for cloning a private git repository with Ansible.
---
hosts: all
tasks:
- name: add github ssh key
copy: >
src=files/id_rsa.github
dest=/root/.ssh/id_rsa.github
owner=root
group=root
@yefim
yefim / Dockerrun.aws.json
Last active April 7, 2023 16:11
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}
@gwillem
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created June 16, 2016 21:59
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# [email protected]
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)