Skip to content

Instantly share code, notes, and snippets.

@1gor
1gor / adamwalz.net.nginxconf
Created July 16, 2019 05:31 — forked from adamwalz/adamwalz.net.nginxconf
Jekyll optimized nginx server configuration used on adamwalz.net
server {
server_name www.adamwalz.net;
return 301 $scheme://adamwalz.net$request_uri;
}
server {
server_name adamwalz.net *.adamwalz.net;
root /home/adamwalz/Sites/adamwalz.net;
access_log /var/log/nginx/adamwalz.net/access.log;
@1gor
1gor / class-templater.php
Created July 2, 2019 04:12 — forked from Maximilianos/class-templater.php
Register custom page templates in WordPress programmatically in a plugin or in the theme without even requiring real template files.
<?php
/**
*
*/
/**
* Class MCF_Templater
*
* Based on work by Harri Bell-Thomas <https://github.com/HarriBellThomas>
@1gor
1gor / Ansible Let's Encrypt Nginx setup
Created June 12, 2019 13:31 — 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)
@1gor
1gor / .gitconfig
Created June 9, 2019 14:44 — forked from Wirone/.gitconfig
GIT & GitFlow aliases for ~/.gitconfig
# GIT aliases for ~/.gitconfig file
# @author Grzegorz Korba <[email protected]>
# Credits: Miscellaneous places on the Internet...
# GitFlow related sections
[gitflow "branch"]
master = master
develop = develop
[gitflow "prefix"]
feature = feature/
@1gor
1gor / gist:ebfe4482e719ab422fa249be814b6c1a
Created May 14, 2019 03:50 — forked from kalmbach/gist:4471560
Rake task sugar for Sequel Migrations (version, migrate, rollback, reset)
namespace :db do
require "sequel"
Sequel.extension :migration
DB = Sequel.connect(ENV['DATABASE_URL'])
desc "Prints current schema version"
task :version do
version = if DB.tables.include?(:schema_info)
DB[:schema_info].first[:version]
end || 0
@1gor
1gor / CF7 Form
Created April 20, 2019 04:46 — forked from Tmeister/CF7 Form
Contact Form 7 - User Profile
<label> Your Name (required)
[text* your-name] </label>
<label> Your Email (required)
[email* your-email] </label>
<label> Your Phone (required)
[tel* your-phone] </label>
<label> Subject
@1gor
1gor / backup-host.sh
Created April 3, 2019 07:32 — forked from dado-prateek/backup-host.sh
Backup with duplicity to yandex.disk
#!/bin/sh
# Duplicity wrapper
#
# add to crontab:
# 0 0 * * * /bin/sh /usr/local/sbin/backup-host.sh
set -e
PASSPHRASE="long_passphrase"
@1gor
1gor / gist:3636abe441885d1e0a2f35ba91b2eae9
Created March 1, 2019 10:40 — forked from louismullie/gist:2394767
Sinatra Servlet That Forks Background Processes and Allows Polling Them Through DRb
require 'sinatra'
require 'fileutils'
require 'cgi'
require 'drb'
TmpDir = './tmp/'
ServiceFile = 'services.txt'
def local_get(url)
@1gor
1gor / components.rb
Created February 16, 2019 13:36 — forked from jgaskins/components.rb
React Router v4-style routing for Clearwater
require 'routing'
class Layout
include Clearwater::Component
include Routing
def render
div([
nav([
Link.new({ href: '/' }, 'Home'),
@1gor
1gor / app.rb
Created February 16, 2019 13:36 — forked from jgaskins/app.rb
React Router v4-style routing in Clearwater
require 'opal'
require 'clearwater'
require 'routing'
class Layout
include Clearwater::Component
include Routing
def render
div([