-
Use heroku caddybuild pack with git pull
-
Tell Caddy to pull from github repo
-
Post pull command, run hugo on files from git repo
-
Add / Edit articles using github ace editor or git push
-
Caddy pulls repo files and rebuilds hugo site.
This file contains hidden or 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
module.exports = { | |
production: { | |
buildEnv: 'production', // Override the environment passed to the ember asset build. Defaults to 'production' | |
store: { | |
type: "S3", | |
accessKeyId: "XXX", | |
secretAccessKey: "XXX", | |
bucket: "bucket-index", | |
acl: 'public-read', //optional, e.g. 'public-read', if ACL is not configured, it is not sent | |
endpoint: "storage.googleapis.com", |
This file contains hidden or 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
defmodule Struct.Api.V1.UserController do | |
use Phoenix.Controller | |
alias Poison, as: JSON | |
import Ecto.Query, only: [from: 2] | |
plug Struct.AuthenticationPlug | |
plug :action | |
def update(conn, _params) do | |
user = conn.assigns[:current_user] | |
if user do |
This file contains hidden or 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
defmodule Struct.AuthenticationPlug do | |
alias Plug.Conn | |
alias Phoenix.Status | |
alias Phoenix.Controller.Errors | |
alias Poison, as: JSON | |
import Phoenix.Controller.Connection | |
import Plug.Conn | |
import Ecto.Query, only: [from: 2] | |
def init(opts), do: opts |
This file contains hidden or 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
# Originally from http://sharebear.co.uk/blog/2009/09/17/very-simple-python-caching-proxy/ | |
# | |
# Usage: | |
# A call to http://localhost:80000/example.com/foo.html will cache the file | |
# at http://example.com/foo.html on disc and not redownload it again. | |
# To clear the cache simply do a `rm *.cached`. To stop the server simply | |
# send SIGINT (Ctrl-C). It does not handle any headers or post data. | |
import BaseHTTPServer | |
import hashlib |
This file contains hidden or 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
remote: Installing collected packages: markupsafe, six, PyYAML, webassets, itsdangerous, Jinja2, Werkzeug, python-frontmatter, hamlish-jinja, Flask-Assets, frozen-flask, gunicorn, flask | |
remote: Running setup.py install for markupsafe | |
remote: building 'markupsafe._speedups' extension | |
remote: gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/app/.heroku/python/include/python2.7 -c markupsafe/_speedups.c -o build/temp.linux-x86_64-2.7/markupsafe/_speedups.o | |
remote: gcc -pthread -shared build/temp.linux-x86_64-2.7/markupsafe/_speedups.o -o build/lib.linux-x86_64-2.7/markupsafe/_speedups.so | |
remote: | |
remote: Running setup.py install for PyYAML | |
remote: checking if libyaml is compilable | |
remote: gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/app/.heroku/python/include/python2.7 -c build/temp.linux-x86_64-2.7/check_libyaml.c -o build/temp.l |
This file contains hidden or 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
module Slack | |
class Invite | |
def call(options) | |
email = options[:email] | |
throw "You must call this method with an email" unless email.present? | |
invite = agent.post("https://#{ENV['SLACK_SUBDOMAIN']}.slack.com/api/users.admin.invite?t=#{Time.now.to_i}", | |
{"email" => email, | |
"token" => ENV['SLACK_API_TOKEN'], | |
"set_active" => "true", | |
"_attempts" => "1" |
This file contains hidden or 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
from waitlisted import reservation | |
res = reservation.create({'email': '[email protected]'}) | |
print "Your position is " + res.position + " of " + res.total |
This file contains hidden or 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
Rails.application.configure do | |
# Settings specified here will take precedence over those in config/application.rb. | |
# Code is not reloaded between requests. | |
config.cache_classes = true | |
# Eager load code on boot. This eager loads most of Rails and | |
# your application in memory, allowing both threaded web servers | |
# and those relying on copy on write to perform better. | |
# Rake tasks automatically ignore this option for performance. |
This file contains hidden or 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
.dt.pvx-ns.pvs | |
.wi-100.tc | |
.wi-10.fl | |
| |
.wi-100.wi-20-ns.phn-ns.phx.fl | |
= fa_icon "users", class: "fa-5x" | |
.f3 | |
Affiliate System | |
.f5 | |
Lorem impsum |