Skip to content

Instantly share code, notes, and snippets.

version: '2'
volumes:
nextcloud:
db:
services:
db:
image: mariadb
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
@ctorgalson
ctorgalson / gitbranch.py
Created July 23, 2019 19:56
Simple Python script to simplify making git branches based on a Trello path and the current date.
#!/usr/bin/env python3
"""
This script:
- prompts the user for a Trello path,
- validates that the provided path fits the expected pattern,
- splits it at the `/`,
- replaces `-` with `_`,
@ctorgalson
ctorgalson / datesort.php
Last active August 5, 2016 16:30
Simplified date sort query
<?php
/**
* Called to add the sort to a query.
*/
public function query() {
$this->ensureMyTable();
$configuration = [
'table' => 'node__field_event_date',
<p>8HY - 4 Lead Bi-Polar</p>

<table border="1" cellpadding="1" cellspacing="1">
  <thead>
    <tr>
      <th scope="row" style="background-color: rgb(197, 217, 241);">&nbsp;</th>
      <th colspan="2" scope="col" style="background-color: rgb(197, 217, 241);">Model Number</th>
      <th scope="col" style="background-color: rgb(197, 217, 241);">Connect</th>
      <th scope="col" style="background-color: rgb(197, 217, 241);">Rated Current</th>
@ctorgalson
ctorgalson / 384-vagrant-up-fails-at-restart-php-fpm.diff
Created January 21, 2016 21:26
Adds `extra_parameters` to Apache VirtualHosts
diff --git a/example.config.yml b/example.config.yml
index c1ffbb7..1559c62 100644
--- a/example.config.yml
+++ b/example.config.yml
@@ -75,7 +75,9 @@ configure_local_drush_aliases: true
# Apache VirtualHosts. Add one for each site you are running inside the VM. For
# multisite deployments, you can point multiple servernames at one documentroot.
-# View the geerlingguy.apache Ansible Role README for more options.
+# Note that Apache VirtualHosts requiring PHP must include extra_parameters
@ctorgalson
ctorgalson / SublimeLinter.sublime-settings.json
Last active November 23, 2015 12:37
Sample Sublime config file for enabling PHP_CodeSniffer
{
"user":{
"debug":true,
"delay":0.5,
"error_color":"D02000",
"gutter_theme":"Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
"gutter_theme_excludes":[
],
"lint_mode":"background",
@ctorgalson
ctorgalson / gist:a62655267a966a6b0331
Created November 2, 2014 16:52
Generate a passphrase protected 4096 bit rsa keypair with a custom name
Username$ ssh-keygen -b 4096 -t rsa -f ~/.ssh/demo_key
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/Username/.ssh/demo_key.
Your public key has been saved in /Users/Username/.ssh/demo_key.pub.
The key fingerprint is:
dd:6b:c9:de:d0:df:3c:74:92:97:1c:97:7b:7d:9b:fb Username@Username.local
The key's randomart image is:
+--[ RSA 4096]----+
@ctorgalson
ctorgalson / gist:6829101
Created October 4, 2013 16:57
Feedburner 302 redirect
RewriteCond %{HTTP_USER_AGENT} !FeedBurner
RewriteRule ^/feed/path$ http://feeds.feedburner.com/feedname [R=302,L]
@ctorgalson
ctorgalson / gist:6769905
Created September 30, 2013 20:37
Drupal theme Flickr photoset into Foundation Clearing gallery
<?php
function themename_flickrfield_photoset($variables) {
$img = $variables['0'];
$photo_url = $variables['1'];
$formatter = $variables['2'];
$photo_data = $variables['3'];
$node = $variables['4'];
//
$output = '<ul class="clearing-thumbs flickr-photoset">';
@ctorgalson
ctorgalson / vhost-pagekite
Created September 16, 2013 16:50
Virtual host for use with Pagekite where the Pagekite subdomain 'component-something.pagekite.me' exists in your account. Remember to set up '127.0.0.1 component.local www.component.local' in /etc/hosts.
<VirtualHost *:80>
ServerName component.local
ServerAlias www.component.local
ServerAlias component-something.pagekite.me
DocumentRoot /Users/Pigsy/Sites/component/public_html
<Directory /Users/Pigsy/Sites/component/public_html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all