Skip to content

Instantly share code, notes, and snippets.

View a-bx's full-sized avatar

Abraham Barrera a-bx

  • Migrante
  • Chile
View GitHub Profile
@muscardinus
muscardinus / sunspot.cap
Last active December 17, 2023 03:04
sunspot tasks for Capistrano 3
namespace :deploy do
before :updated, :setup_solr_data_dir do
on roles(:app) do
unless test "[ -d #{shared_path}/solr/data ]"
execute :mkdir, "-p #{shared_path}/solr/data"
end
end
end
end
# String extensions
class String
def cavgsify
gsub /ca([Z b-df-hj-np-tv-z]|[ ]|\Z)/, 'cavg\1'
end
def ochoafy
gsub /a/, 'aaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaAaaaA'
end
@kennethkalmer
kennethkalmer / nginx.conf
Last active August 3, 2021 19:44
Sample nginx config for serving a rails API and static frontend like Ember on the same domain...
daemon off;
worker_processes 4;
events {
use epoll;
accept_mutex on;
multi_accept on;
worker_connections 1024;
}
@goncalvesjoao
goncalvesjoao / Gemfile
Last active November 13, 2020 01:52
Changes you need to make in order to make Devise use JWT Header Authentication
# Add the "https://github.com/jwt/ruby-jwt" gem to your "Gemfile"
gem 'jwt'
@markheath
markheath / docker-compose-v1.yml
Last active September 6, 2024 01:23
Elasticsearch docker compose examples
version: '2.2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.4.1
container_name: elasticsearch
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits: