Skip to content

Instantly share code, notes, and snippets.

👣
~~~~~~~~~

Hector Correa hectorcorrea

👣
~~~~~~~~~
Block or report user

Report or block hectorcorrea

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hectorcorrea
hectorcorrea / passenger_report.rb
Last active Sep 4, 2018
Creates a tab delimited list from the passenger status log file.
View passenger_report.rb
# Parses a file with the output of `passenger-status` and outputs a
# tab delimited list with the date and number of requests in queue
# that `passenger-status` reported.
#
# The file `passenger_status.log` is created with via a cron job that
# runs every X minutes as follows:
#
# /path/to/.gem/gems/passenger-5.1.12/bin/passenger-status >> ./logs/passenger_status.log
#
#
View solr_installation.md

Installing Solr for the first time

Prerequisites

To run Solr on your machine you need to have the Java Development Kit (JDK) installed. The version of Solr that we'll use in this tutorial requires a recent version of Java (Java 8 or greater). To verify if the JDK is installed run the following command from the Terminal (aka Command Prompt if you are on Windows):

$ java --version
@hectorcorrea
hectorcorrea / server.go
Last active Oct 10, 2017
An example on how to generate a local SSL certificate in Go and serve HTTPS traffic with it
View server.go
// An example on how to generate a local SSL certificate in Go
// and serve HTTPS traffic with it.
//
// Code taken from the book Go Web Programming by Sau Sheong Chang
// https://github.com/sausheong/gwp
//
// Run with `--https` to serve traffic via HTTPS (it will create the certificate
// and private key files if they don't exist)
//
// Run with no parameters to serve traffic via HTTP (no certificates needed)
@hectorcorrea
hectorcorrea / solr.sh
Last active Jul 5, 2017
Solr shortcuts
View solr.sh
# Delete one Solr document by ID
curl "http://localhost:8080/solr/blacklight-core/update?commit=true" \
-H "Content-Type: text/xml" \
--data-binary '<delete><id>xyz</id></delete>'
# Delete ALL Solr documents
curl "http://localhost:8080/solr/blacklight-core/update?commit=true" \
-H "Content-Type: text/xml" \
--data-binary '<delete><query>*:*</query></delete>'
@hectorcorrea
hectorcorrea / main.go
Created Jun 15, 2017
Pass by value vs pass by reference in Go
View main.go
// In this post https://dave.cheney.net/2017/04/29/there-is-no-pass-by-reference-in-go
// Dave Cheney says that "there is no pass-by-reference in Go"
// but this snipet shows that there is.
//
// What am I missing?
//
package main
import (
"fmt"
@hectorcorrea
hectorcorrea / node_modules-in-git.md
Created Jan 19, 2017 — forked from sukima/node_modules-in-git.md
Archive of mikeal's post since his server went down today
View node_modules-in-git.md

node_modules in git

December 10 2011
By mikeal

One of the many things we have been forced to rethink in the world of node is how we handle dependencies in applications.

One of the big changes that came with 0.4.0 was support for node_modules. This change had major consequences. It elevated local modules, in a local directory, above modules installed globally. Along with npm changing its default install preference to local rather than global we've seen a nearly unanimous shift to local module installs that has made global installs somewhat distasteful.

@hectorcorrea
hectorcorrea / forever-initd-hectorcorrea.sh
Last active Jan 18, 2017
A sample init.d script to start a CoffeeScript application through forever. This used to be part of the source code of my hectorcorrea.com repo but since I have deleted the CoffeeScript code this script was lost. This gist is to preserve it for posterity since it is referenced in a StackOverflow question.
View forever-initd-hectorcorrea.sh
#!/bin/bash
#
# initd-example Node init.d
#
# chkconfig: 345
# description: Script to start a coffee script application through forever
# processname: forever/coffeescript/node
# pidfile: /var/run/forever-initd-hectorcorrea.pid
# logfile: /var/run/forever-initd-hectorcorrea.log
#
@hectorcorrea
hectorcorrea / frbr.md
Last active Aug 29, 2015
Notes from FRBR + Fedora + Inheritance meeting
View frbr.md

FRBR + Fedora + Inheritance

My notes from the Google Hangout organized by Christina Harlow (@cm_harlow) on 7/14/2015

Keep in mind that I captured this as the video call went on and I might have gotten some of it wrong. I'll update this page with a link to the recording once it becomes available.

What is FRBR?

FRBR (Functional Requirements for Bibliographic Records) is a 1998 recommendation of the International Federation of Library Associations and Institutions (IFLA) to restructure catalog databases to reflect the conceptual structure of information resources. - http://www.oclc.org/research/activities/frbr.html

@hectorcorrea
hectorcorrea / ldp_containers.md
Last active Sep 16, 2015
A summary of the basic differences between the different kind of containers that LDP supports.
View ldp_containers.md

This document is a summary of the basic differences between the different kind of containers that Linked Data Platform (LDP) supports.

LDP specifies three types of containers:

  1. Basic Container
  2. Direct Container
  3. Indirect Container.

This documents describes the differences between the three types of containers by showing what triples are added by an LDP Server when adding a new element to each kind of container.

In particular we assume we have a fictitious blog entry (/blog/entry1/) and we want to add a comment to it. We start by showing what happens if the blog entry is a Basic Container, then we show what happens if the blog entry was instead a Direct Container, and lastly if it was an Indirect Container.

@hectorcorrea
hectorcorrea / rdf4rdbms.md
Last active Feb 18, 2017
RDF for Relational Database heads
View rdf4rdbms.md
You can’t perform that action at this time.