This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'scraperwiki' | |
# Members of the Legislative Assembly of New Brunswick | |
# If you really want to get the photo url it is available following the url for each MLA. | |
require 'iconv' | |
require 'open-uri' | |
require 'nokogiri' | |
require 'uri' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashMap; | |
import java.util.Map; | |
public class Unicorn { | |
// The locations of unicorns in our magical, one-dimensional land | |
private static final int UNICORN_ONE_LOCATION = 4; | |
private static final int UNICORN_TWO_LOCATION = 10; | |
// Let's create a game keeper for the magical land to keep track of where all the Unicorns are! | |
private static final Map<Integer, Unicorn> UNICORN_GAME_KEEPER = new HashMap<Integer, Unicorn>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SecuritySpelBeanResolverInjector implements BeanFactoryAware, BeanPostProcessor { | |
private BeanFactory factory; | |
@Override | |
public Object postProcessAfterInitialization(Object bean, String beanName) | |
throws BeansException { | |
if (bean instanceof ExpressionBasedPreInvocationAdvice) { | |
((ExpressionBasedPreInvocationAdvice) bean).setExpressionHandler(new CustomMethodSecurityExpressionHandler()); | |
} | |
return bean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
.parent { | |
width: 300px; | |
height: 300px; | |
margin-bottom: 10px; | |
position: relative; | |
-webkit-perspective: 600; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.lashpoint.twitter.quartz; | |
public class RescheduleException extends Error { | |
/** | |
* | |
*/ | |
private static final long serialVersionUID = -253876682421574999L; | |
public RescheduleException(Throwable t) { | |
super(t); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MyApp::View::TT; | |
use strict; | |
use parent 'Catalyst::View::TT'; | |
use Scalar::Util qw(blessed); | |
use DateTime::Format::DateParse; | |
__PACKAGE__->config( |