Skip to content

Instantly share code, notes, and snippets.

View dcorto's full-sized avatar
:octocat:
¯\_(ツ)_/¯

D. Corto dcorto

:octocat:
¯\_(ツ)_/¯
View GitHub Profile
@dcorto
dcorto / functions.php
Last active August 29, 2015 14:09
Wordpress Multisite Custom Sites Name by Lang
<?php
/*
Theme functions.php
*/
function change_site_names() {
global $wp_admin_bar;
if ( function_exists('is_multisite') && is_multisite() ) {
foreach ( (array) $wp_admin_bar->user->blogs as $blog ) {
@dcorto
dcorto / StartSSL.md
Last active February 27, 2016 09:11 — forked from mgedmin/StartSSL.md
Free StartSSL.com SSL certificate HOWTO

How to get a free StartSSL.com SSL certificate

I'm writing this up from memory, so errors may appear.

This has been updated to use SHA256 certificates.

Start

  1. Go to http://www.startssl.com/
  2. Click on 'Control Panel'
@dcorto
dcorto / Ansible Let's Encrypt Nginx setup
Created February 19, 2017 16:37 — forked from mattiaslundberg/Ansible Let's Encrypt Nginx setup
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)
<?php
/**
* Goat Latin is a made-up language based off of English, sort of like Pig Latin.
*
* The rules of Goat Latin are as follows:
* 1. If a word begins with a consonant (i.e. not a vowel), remove the first letter and append it to the end, then add 'ma'.
* For example, the word 'goat' becomes 'oatgma'.
*
* 2. If a word begins with a vowel, append 'ma' to the end of the word.
@dcorto
dcorto / README.md
Last active February 11, 2021 21:21 — forked from jamesramsay/README.md
Gmail: delete old emails automatically

Gmail: delete old emails automatically

Automatically deletes old emails that match the specified label.

Get started

  • Create a new Google Apps Script at https://script.google.com
  • Overwrite the placeholder with the javascript below
  • Update the following constants:
  • LABELS_TO_DELETE: the label that should be have old messages deleted
@dcorto
dcorto / main.go
Created July 14, 2024 19:52
concurrency preempt
package main
import "fmt"
func main() {
ch := make(chan bool)
go func() {
for {
}
}()