How to implement a custom search for Hugo usig Gruntjs and Lunrjs.
Install the following tools:
defmodule Mcrypttest do | |
@algo :rijndael_256 | |
@mode :cfb | |
@key "00000000000000000000000000000000" | |
@iv "00000000000000000000000000000000" | |
def encrypt(plaintext) do | |
Mcrypt.encrypt(plaintext, @algo, @mode, @key, @iv) | |
end |
# Example nginx + git HTTP Smart mode (git-http-backend) + HTTP Authentication + HTTPS redirect | |
# jeroen@massar.ch - 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"
gem 'rom', '0.6.0' | |
gem 'rom-sql', '0.4.0' | |
gem 'rom-rails', '0.3.0' | |
gem_group(:test) do | |
gem "rspec" | |
gem "rspec-rails" | |
gem "capybara" | |
gem "database_cleaner" | |
gem "spring-commands-rspec" |
# 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 |