Skip to content

Instantly share code, notes, and snippets.

View jlsan92's full-sized avatar
🎯
Focusing

Juan Sanchez jlsan92

🎯
Focusing
View GitHub Profile
module.exports.routes = {
'/*': function(req, res, next) {sails.log.verbose(req.method, req.url); next();},
/**
* Session routes
*/
'POST /api/sessions' : 'SessionController.create', // Crea una sesion
'DELETE /api/sessions' : 'SessionController.destroy', // Destruye una sesion
@jlsan92
jlsan92 / mongoose-sails.js
Created October 18, 2017 01:27
Mongoose Sails Hook
const _ = require('lodash');
const mongoose = require('mongoose');
const Promise = require('bluebird');
const Schema = mongoose.Schema;
const ORM_NAME = 'mongoose';
module.exports = function mongooseOrm(sails) {
return {

Keybase proof

I hereby claim:

  • I am jlsan92 on github.
  • I am jlsan92 (https://keybase.io/jlsan92) on keybase.
  • I have a public key ASCGMRH6sShPGhKbTU7qBIv3HLvtIKxdIXRMMLrcBlZuhwo

To claim this, I am signing this object:

@jlsan92
jlsan92 / all-indexes.sql
Created January 14, 2020 12:03 — forked from robertrossmann/all-indexes.sql
Postgres diagnostics
-- List all existing indexes and include some useful info about them (incl. the index's definition)
SELECT
schemaname AS schemaname,
t.relname AS tablename,
ix.relname AS indexname,
regexp_replace(pg_get_indexdef(i.indexrelid), '^[^\(]*\((.*)\)$', '\1') AS columns,
regexp_replace(pg_get_indexdef(i.indexrelid), '.* USING ([^ ]*) \(.*', '\1') AS algorithm,
indisunique AS UNIQUE,
indisprimary AS PRIMARY,
@jlsan92
jlsan92 / gist:9c615cce4cc74db1b75bc20ccba39b61
Last active September 25, 2020 10:03
Provider cannot be instantiated - permission denied - debug output
TF_LOG=DEBUG terraform plan
2020/09/25 09:58:58 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
Use TF_LOG=TRACE to see Terraform's internal logs.
----
2020/09/25 09:58:58 [INFO] Terraform version: 0.12.29
2020/09/25 09:58:58 [INFO] Go runtime version: go1.12.13
2020/09/25 09:58:58 [INFO] CLI args: []string{"/usr/bin/terraform", "plan"}
2020/09/25 09:58:58 [DEBUG] Attempting to open CLI config file: /root/.terraformrc
2020/09/25 09:58:58 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/09/25 09:58:58 [DEBUG] checking for credentials in "/root/.terraform.d/plugins"