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
// BrowserRouter is the router implementation for HTML5 browsers (vs Native). | |
// Link is your replacement for anchor tags. | |
// Route is the conditionally shown component based on matching a path to a URL. | |
// Switch returns only the first matching route rather than all matching routes. | |
import { | |
BrowserRouter as Router, | |
Link, | |
Route, | |
Switch, | |
} from 'react-router-dom'; |
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
#!/bin/bash | |
# Test restart d'une VM sur instance de base Gandi Debian 8 + install par défaut de docker | |
VM=dockersystemd | |
gandi vm create --datacenter LU --memory 1024 --cores 2 --ip-version 4 --hostname $VM --image "Debian 8 64 bits (HVM)" --size 10G | |
echo "Installing docker" | |
gandi vm ssh $VM 'apt-get update && apt-get install -y curl' | |
gandi vm ssh $VM 'curl -sSL https://get.docker.com/ | sh' |
Twit and other Node libraries don't always quite drop into Meteor's reactive architecture right out of the box. Luckily Meteor makes adapting them super-duper easy with wrapAsync. It was so easy that I naturally tried all the more difficult ways first! Since I didn't find a nice gist or StackOverflow example, please enjoy this one.
In the template -
{{#with pos}}
{{#if ready}}
{{> singlePosition data }}
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
<?php | |
/* | |
WORDPRESS SPECIFIC AJAX HANDLER (because admin-ajax.php does not render plugin shortcodes). | |
by [email protected] | |
credits: Raz Ohad https://coderwall.com/p/of7y2q/faster-ajax-for-wordpress | |
*/ | |
//mimic the actual admin-ajax | |
define('DOING_AJAX', true); | |
if (!isset( $_REQUEST['action'])) |
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
define([ | |
'jquery', | |
'underscore' | |
], function ($, _) { | |
var ImageHelper = { | |
initialize: function () { | |
var example = [ | |
"img/image1.jpg", | |
"img/image2.jpg" |
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
#!/bin/bash | |
# Get filename from cmd-line arg | |
filename=$1 | |
# Fetch all remote branches locally and setup tracking | |
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do | |
git branch --track ${branch##*/} $branch | |
done |
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
/*! | |
* Bootstrap's Gruntfile | |
* http://getbootstrap.com | |
* Copyright 2013-2014 Twitter, Inc. | |
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |
*/ | |
module.exports = function (grunt) { | |
'use strict'; |
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
<?php | |
/* | |
Plugin Name: Automatically Title Post | |
Description: Automatically title post based on post type and taxonomy. | |
Version: 1.0.0.RC.1 | |
Author: Nick Ohrn of Plugin-Developer.com | |
Author URI: http://plugin-developer.com/ | |
*/ | |
function automatically_title_post($post_id, $post, $update) { |
NewerOlder