Skip to content

Instantly share code, notes, and snippets.

View tdantas's full-sized avatar
🏠
Working from home

Thiago Dantas tdantas

🏠
Working from home
View GitHub Profile
@tdantas
tdantas / yaml_references.rb
Created August 31, 2013 13:10
YAML References
#!/usr/bin/env ruby
%w(yaml ap).each { |dep| require dep }
obj = YAML::load(DATA)
ap obj['test']['host']
__END__
development: &dev
host: localhost
user: username
@tdantas
tdantas / yaml_json_superset.rb
Last active December 22, 2015 01:38
YAML Ruby
#!/usr/bin/env ruby
%w(yaml ap).each { |dep| require dep }
obj = YAML::load(DATA)
puts "-" * 30
ap obj['firstName']
puts "-" * 30
@tdantas
tdantas / recipe.md
Created July 26, 2013 17:07
Openssl recipes pkcs7 to x509

#HTTPS SSL Apache

We received 2 files.

  • PKCS7
  • Intermediate.crt

###How to extract X.509 from PKCS7 ?

@tdantas
tdantas / virtual.conf
Created July 24, 2013 19:37
apache ssl recipe configuration for our rails configuration
<VirtualHost *:80>
ServerName domain.com
ServerAlias www.domain.com
#ServerAlias *.domain.com
RailsBaseURI /join
<Directory /join>
Options -MultiViews
@tdantas
tdantas / backup
Last active December 17, 2015 06:09
mysql backup instructions debian squeeze
$ sudo innobackupex --user=USER --password=PASSWORD PATH_TO_BACKUP_DIR
@tdantas
tdantas / chef-install.sh
Last active December 16, 2015 12:39
Chef Installer curl - Ubuntu
#!/usr/bin/env bash
apt-get -y update
apt-get -y install libreadline6-dev build-essential libyaml-dev zlib1g-dev libssl-dev
apt-get -y install ruby1.9.3
apt-get -y install ruby1.9.1-dev
gem install chef --no-ri --no-rdoc
var express = require('express');
var redis = require('redis');
const serverType = process.argv[2];
const serverHost = process.argv[3];
const serverPort = parseInt(process.argv[4]);
const redisPort = 6379;
const redisHost = '127.0.0.1';
http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;
# Build an inverted index for a full-text search engine with Redis.
# Copyright (C) 2009 Salvatore Sanfilippo. Under the BSD License.
# USAGE:
#
# ruby invertedindex.rb add somedir/*.c
# ruby invertedindex.rb add somedir/*.txt
# ruby search your query string
require 'rubygems'
require 'redis'

Simplistic Full-Text Search With Redis's Sorted Sets

Howto

git clone git://gist.github.com/923934.git redisearch

cd redisearch