Skip to content

Instantly share code, notes, and snippets.

Avatar

Macario Ortega maca

View GitHub Profile
@maca
maca / CSV.elm
Created Apr 29, 2017
Csv parsing
View CSV.elm
import Regex exposing (split, regex)
import List exposing (..)
import Html exposing (table, tr, td, th, text)
import Dict
input : String
input =
"name,age,gender\nmacario,36,male\nfabian,32,male"
@maca
maca / postgre_sql_database_tasks.rb
Created Sep 2, 2015
postgre_sql_database_tasks monkey patch to exclude schemas from dump.
View postgre_sql_database_tasks.rb
module ActiveRecord
module Tasks # :nodoc:
class PostgreSQLDatabaseTasks # :nodoc:
def structure_dump(filename)
set_psql_env
puts "The monkeypatch located in #{__FILE__} should be removed when upgrading to Rails 5.0"
search_path = nil # Dump all schemas
unless search_path.blank?
@maca
maca / expected.json
Created Dec 12, 2014
expected.json
View expected.json
[
{
"name":"Ciencia",
"parent_id":null,
"id":7,
"children":[
{
"name":"Psicología",
"parent_id":7,
"id":12,
@maca
maca / output.json
Created Dec 12, 2014
output.json
View output.json
[
{
"name":"Ciencia",
"parent_id":null,
"id":7,
"children":[
{
"name":"Psicología",
"parent_id":7,
"id":12,
View gitlab-ci-runner
#!/sbin/runscript
# GitLab Runner init script for Gentoo Linux
GITLAB_RUNNER_BASE=/home/runner/gitlab-runners/gitlab-ci-runner
GITLAB_RUNNER_USER=runner
depend() {
need net
}
View gitlab-ci
#!/sbin/runscript
# GitLab-CI 4.3 init script for Gentoo Linux
GITLAB_BASE=/home/gitlab_ci/gitlab-ci
GITLAB_USER=gitlab_ci
depend() {
need net redis
}
@maca
maca / gitlab
Last active Apr 8, 2018
Gitlab nginx vhost
View gitlab
# GITLAB
# Maintainer: @randx
# App Version: 4.0
upstream gitlab {
server unix:/home/git/gitlab/tmp/sockets/gitlab.socket;
}
server {
listen 443;
@maca
maca / account.rb
Last active Sep 21, 2019
spec/models/identity.rb
View account.rb
# app/models/account.rb
class Account < ActiveRecord::Base
devise :database_authenticatable, :registerable, :recoverable,
:rememberable, :trackable, :validatable, :confirmable, :validatable,
:omniauthable, omniauth_providers: [:facebook]
has_many :identities, dependent: :destroy
has_one :profile
View devise.es.yml
# Traducciones adicionales en https://github.com/plataformatec/devise/wiki/I18n
es:
devise:
confirmations:
confirmed: "Tu cuenta ya ha sido confirmada."
confirmed_and_signed_in: "Tu cuenta ya ha sido confirmada. Has sido identificado."
send_instructions: "Recibirás un correo electrónico en unos minutos con instrucciones sobre cómo restablecer tu contraseña."
send_paranoid_instructions: "Si tu correo electrónico existe en nuestra base de datos recibirás un correo electrónico en unos minutos con instrucciones sobre cómo reiniciar tu contraseña."
failure:
View gist:caa8db62653be1ece4fc
development:
secret_key_base: 'hardoced-value-for-simplicity'
facebook_app_id: 'hardoced-value-for-simplicity'
facebook_app_secret: 'hardoced-value-for-simplicity'
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> # I want to raise an exception early if the ENV var is not set
facebook_app_id: <%= ENV["FACEBOOK_APP_ID"] %>
facebook_app_secret: <%= ENV["FACEBOOK_APP_SECRET"] %>
You can’t perform that action at this time.