Skip to content

Instantly share code, notes, and snippets.

@sld
sld / product.rb
Created March 13, 2012 12:38 — forked from clemens/product.rb
the query selects all ids from the full branch from the nested set
class Product
define_index do
# ...
has %(
(
SELECT GROUP_CONCAT(IFNULL(parent.`id`, '0') SEPARATOR ',')
FROM `categories` AS node,
`categories` AS parent
WHERE node.`merchant_id` = `products`.`merchant_id` AND
parent.`merchant_id` = `products`.`merchant_id` AND
@sld
sld / binarytree.rb
Created April 4, 2012 17:07 — forked from yuya-takeyama/binarytree.rb
Binary Tree implemented in Ruby.
module BinaryTree
class Node
attr_reader :word, :count, :left, :right
include Enumerable
def initialize(word)
@word, @count = word, 1
end
@sld
sld / eliza.py
Created October 5, 2017 21:28 — forked from bebraw/eliza.py
import pyeliza
class Eliza:
aliases = 'eliza'
description = 'Virtual therapist'
_therapist = pyeliza.eliza()
def execute(self, expression, context):
'''
>>> from mock import Mock
@sld
sld / install-comodo-ssl-cert-for-nginx.rst
Created March 14, 2018 11:21 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert