Skip to content

Instantly share code, notes, and snippets.

View roelofjan-elsinga's full-sized avatar
Building fast applications

Roelof Jan Elsinga roelofjan-elsinga

Building fast applications
View GitHub Profile
@roelofjan-elsinga
roelofjan-elsinga / index.html
Created May 6, 2020 09:02
Structured data for FAQ
<script type="application/ld+json">
{
"@context": "https:\/\/schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "How often do I water the Calathea Ornata?",
"acceptedAnswer": {
"@type": "Answer",
@roelofjan-elsinga
roelofjan-elsinga / index.html
Last active May 6, 2020 09:30
Structured data for Logo
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Organization",
"url": "https://www.roelofjanelsinga.com",
"logo": "https://www.roelofjanelsinga.com/images/logo/logo_avatar.jpg"
"name": "Roelof Jan Elsinga"
}
</script>
@roelofjan-elsinga
roelofjan-elsinga / index.html
Created May 6, 2020 09:41
Structured data for Sitelinks searchbox
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"url": "https://roelofjanelsinga.com/",
"potentialAction": {
"@type": "SearchAction",
"target": "https://roelofjanelsinga.com/articles?q={search_term_string}",
"query-input": "required name=search_term_string"
}
@roelofjan-elsinga
roelofjan-elsinga / main.go
Created May 13, 2020 09:56
A basic Go application
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
@roelofjan-elsinga
roelofjan-elsinga / main.go
Created May 13, 2020 10:10
A Go application to print a custom string and number to the terminal
package main
import (
"flag"
"fmt"
"strconv"
)
func main() {
var message = flag.String(
@roelofjan-elsinga
roelofjan-elsinga / main.go
Last active May 13, 2020 11:22
A Go application to copy the contents of a source file to a target file
package main
import (
"flag"
"fmt"
"io/ioutil"
"os"
)
func main() {
@roelofjan-elsinga
roelofjan-elsinga / playbook.yml
Last active June 7, 2020 15:13
A sample Ansible playbook to deploy changes to a Laravel application
- hosts: roelofjanelsinga.com # You can also specify an IP address
vars_files:
- secrets.yml # Contains the github_user and github_token variable
vars: # Define new variables
github_repo_url: https://{{github_user}}:{{github_token}}@github.com/roelofjan-elsinga/portfolio.git
working_directory: /path/to/app
tasks:
- name: "Pull changes from GitHub"
git:
repo: "{{github_repo_url}}", # This is how we can make this step reusable across projects
@roelofjan-elsinga
roelofjan-elsinga / main.yml
Created June 10, 2020 14:09
An ansible role to pull changes from a repository
- name: "Pull changes from GitHub"
git:
repo: "{{github_repo_url}}", # This is how we can make this step reusable across projects
dest: "{{working_directory}}"
version: master # Branch to pull
accept_hostkey: yes
notify:
- install_composer_deps
- cache_laravel_config
- clear_laravel_views
@roelofjan-elsinga
roelofjan-elsinga / playbook.yml
Created June 10, 2020 14:10
A sample Ansible playbook with roles deploy changes to a Laravel application
- hosts: roelofjanelsinga.com
vars_files:
- secrets.yml
vars:
github_repo_url: https://{{github_user}}:{{github_token}}@github.com/roelofjan-elsinga/portfolio.git
working_directory: /path/to/app
roles:
- deploy_laravel_app
@roelofjan-elsinga
roelofjan-elsinga / main.yml
Created June 10, 2020 14:33
An Ansible example of a handlers file
- name: install_composer_deps
script: composer install --no-scripts --no-dev
- name: cache_laravel_config
script: "php artisan config:cache"
- name: clear_laravel_views
script: "php artisan view:clear"
- name: run_laravel_migrations