How to implement a custom search for Hugo usig Gruntjs and Lunrjs.
Install the following tools:
| # Phoenix Framework - A productive web framework that does not compromise speed and maintainability | |
| [Unit] | |
| Description=Phoenix Framework ISControl Application | |
| After=network.target | |
| [Service] | |
| Type=simple | |
| User=deployer | |
| RemainAfterExit=yes |
| # Example nginx + git HTTP Smart mode (git-http-backend) + HTTP Authentication + HTTPS redirect | |
| # [email protected] - http://jeroen.massar.ch | |
| server { | |
| listen 192.0.1.1:80; | |
| listen [2001:db8::1]:80; | |
| # Redirect all non-HTTPS traffic to the HTTPS variant | |
| return 301 https://$host$request_uri; | |
| } |
| # https://minhajuddin.com/2016/03/03/put-this-in-your-code-to-debug-anything | |
| require 'rouge' | |
| require 'method_source' | |
| require 'pp' | |
| class Dbg | |
| def initialize(object, to:) | |
| @object, @stream = object, to | |
| end |
| #!/bin/sh | |
| SESSION_NAME="big_red" | |
| cd ~/Sites/within3/big_red | |
| tmux has-session -t ${SESSION_NAME} | |
| if [ $? != 0 ] | |
| then |
irb(main):029:0* GeoEntity.last
GeoEntity Load (0.5ms) SELECT geo_entities.* FROM geo_entities ORDER BY geo_entities.id DESC LIMIT 1
returns:
County id: 4, eid: nil, pid: nil, ename: nil, etype: 2, created_at: "2011-11-21 06:26:37", updated_at: "2011-11-21 06:26:37"
| # Author: Pieter Noordhuis | |
| # Description: Simple demo to showcase Redis PubSub with EventMachine | |
| # | |
| # Update 7 Oct 2010: | |
| # - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
| # the WebSocket protocol implementation in the cramp gem does not work | |
| # well with Chrome's (newer) WebSocket implementation. | |
| # | |
| # Requirements: | |
| # - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
| class PdfMerger | |
| def merge(pdf_paths, destination) | |
| first_pdf_path = pdf_paths.delete_at(0) | |
| Prawn::Document.generate(destination, :template => first_pdf_path) do |pdf| | |
| pdf_paths.each do |pdf_path| | |
| pdf.go_to_page(pdf.page_count) |