Skip to content

Instantly share code, notes, and snippets.

@tpowellcio
tpowellcio / ssl_certs.md
Created May 24, 2016 14:30
Creating SSL Certs

#Creating Certificates Reference

  1. From a terminal:
openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr
  1. Enter the requested information:
  2. Common Name: The fully-qualified domain name, or URL, you're securing. If you are requesting a Wildcard certificate, add an asterisk (*) to the left of the common name where you want the wildcard, for example *.coolexample.com.
  3. Organization: The legally-registered name for your business. If you are enrolling as an individual, enter the certificate requestor's name.
@cvan
cvan / HOWTO.md
Last active May 16, 2025 06:07
How to serve a custom HTTPS domain on GitHub Pages with CloudFlare: *FREE*, secure and performant by default

Instructions

CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.

  1. Make sure you have registered a domain name.
  2. Sign up for CloudFlare and create an account for your domain.
  3. In your domain registrar's admin panel, point the nameservers to CloudFlare's (refer to this awesome list of links for instructions for various registrars).
  4. From the CloudFlare settings for that domain, enable HTTPS/SSL and set up a Page Rule to force HTTPS redirects. (If you want to get fancy, you can also enable automatic minification for text-based assets [HTML/CSS/JS/SVG/etc.], which is a pretty cool feature if you don't want already have a build step for minification.)
  5. If you
@docapotamus
docapotamus / swappiness.md
Last active May 2, 2025 18:20
Setting swappiness on Debian

Swappiness controls the tendancy the kernel wishes to swap.

Even with free memory the kernel may swap.

100 means aggressively swap 0 means wait until the last minute to swap

To check current swappiness cat /proc/sys/vm/swappiness

@Dufgui
Dufgui / gist:72debe81068bf3ecd7d8
Last active April 25, 2023 14:34 — forked from eduardocardoso/gist:82a629882ddb02ab3677
Script to delete exited containers and untagged/unused images from docker
#!/bin/bash
set -o errexit
echo "Removing exited docker containers..."
docker ps -a -f status=exited -q | xargs -r docker rm -v
echo "Removing dangling images..."
docker images --no-trunc -q -f dangling=true | xargs -r docker rmi
@skazhy
skazhy / conj15.md
Created November 18, 2015 21:20
Conj 2015 notes + links

clojure/conj 2015 notes

All of the talks are on YouTube. Conj 2015 on Lanyrd.

Clojure

State machines for Clojure

@kasparsd
kasparsd / index.html
Last active June 12, 2023 05:18
Get user timezones using Slack API
<!doctype html>
<html ng-app="timezoneApp">
<head>
<title>Team Timezones</title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
<script>
var period = 172800; // 2 days in seconds
var now = new Date();
var utc = new Date( now.getTime() + now.getTimezoneOffset() * 60000 );
var seconds_today = utc.getSeconds() + ( 60 * ( utc.getMinutes() + ( 60 * utc.getHours() ) ) );
@infusion
infusion / import-tar-gz.sh
Last active May 4, 2023 06:00
Import a tar.gz file to MySQL
tar xOf dump.sql.tar.gz | mysql -u $user -p $database

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
/*
* draw a multiline string rotated in a canvas
*
* @param ctx (M) context of the canvas
* @param text (M) string may contain \n
* @param posX (M) horizontal start position
* @param posY (M) vertical start position
* @param textColor color
* @param rotation in degrees (by 360)
* @param font must be installed on client use websafe
/*
All code apart from getPlusones()
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0