Skip to content

Instantly share code, notes, and snippets.

View rivenvirus's full-sized avatar

Santiago Pérez rivenvirus

  • Sorcode
  • Mérida Yucatán
View GitHub Profile
@rivenvirus
rivenvirus / pipes.module.ts
Last active November 22, 2020 13:32
Thumbor Pipe for Angular 7
import { NgModule } from '@angular/core';
import { ThumborPipe } from './thumbor.pipe';
@NgModule({
imports: [
// dep modules
],
declarations: [
ThumborPipe
],
@rivenvirus
rivenvirus / settings.json
Created October 10, 2018 18:40
Visual Studio Code - Deploy Plugin Config
{
"deploy": {
"host": {
"dir": "./files_from_remotes"
},
"packages": [
{
"name": "Deploy Package",
"description": "",
"files": [
@rivenvirus
rivenvirus / .gitignore
Created October 10, 2018 18:38
Wordpress GIT Ignore
### VSCode
.vscode/
### WordPress
/*
!wp-content/
!wp-config.php
!.htaccess
!.gitignore
@rivenvirus
rivenvirus / gist:de04688c4d10b50cae14ae7688e859e7
Created July 22, 2018 03:00 — forked from zdwolfe/gist:6721115
Basic nginx configuration for AngularJS html5Mode
server {
listen 0.0.0.0:12345;
location / {
root /home/zdwolfe/src/angularAWS/app;
try_files $uri $uri/ /index.html =404;
}
}
@rivenvirus
rivenvirus / 0-model-override.js
Created July 4, 2018 01:04 — forked from spencermefford/0-model-override.js
An alternative to extending Loopback's built in models. In our application, we wanted to create a custom role called "ecm-administrator" that would have the ability to create and manage users.
module.exports = function (app) {
var _ = require('lodash');
var User = app.models.User;
var Role = app.models.Role;
var RoleMapping = app.models.RoleMapping;
var ACL = app.models.ACL;
/*
* Configure ACL's
*/
@rivenvirus
rivenvirus / admin-access.js
Created July 4, 2018 00:58 — forked from leftclickben/admin-access.js
An alternative to extending Loopback's built-in models: use a boot script to enhance the built-in model
(function () {
'use strict';
// Relevant resource: https://gist.github.com/spencermefford/bc73812f216e0e254ad1
module.exports = function (server, callback) {
var ACL = server.models.ACL,
User = server.models.User,
Role = server.models.Role,
RoleMapping = server.models.RoleMapping;
@rivenvirus
rivenvirus / DisableAllMethods.js
Created June 5, 2018 22:19 — forked from drmikecrowe/DisableAllMethods.js
Loopback mixin to disable or expose methods
// based on https://github.com/strongloop/loopback/issues/651#issuecomment-259540469
'use strict';
const
relationMethodPrefixes = [
'prototype.__findById__',
'prototype.__destroyById__',
'prototype.__updateById__',
'prototype.__exists__',
@rivenvirus
rivenvirus / disableAllMethods.js
Created June 5, 2018 22:17 — forked from ratik/disableAllMethods.js
LoopbackJs disable all remote methods and enable only selected
/**
* Based on @ericprieto code https://github.com/strongloop/loopback/issues/651#issuecomment-140879983
* place this file into common/mixins/disableAllMethods.js
*
**/
module.exports = function(Model, options) {
if(Model && Model.sharedClass) {
var methodsToExpose = options.expose || [];
@rivenvirus
rivenvirus / wc-remove-billing-fields.php
Created April 22, 2018 19:19 — forked from cagartner/wc-remove-billing-fields.php
WooCommerce - Remove billing address, fone and company fields
<?php
/**
* Plugin Name: WooCommerce Remove billing fields
* Description: Remove billing address, fone and company fields from WooCommerce checkout.
* Author: Claudio Sanches
* Author URI: https://claudiosmweb.com
* Version: 0.0.1
* License: GPLv2 or later
*/
@rivenvirus
rivenvirus / compile-nginx-from-source.sh
Last active August 28, 2018 20:08 — forked from nurrony/compile-nginx-from-source.sh
All configuration files needed to install nginx on Ubuntu 16.04 Compile Nginx from source with nginx-rtmp-module, pagespeed and cache-purge module.
#change it to latest version
#USE NGINX 1.12.2
NPS_VERSION=1.11.33.4;
echo "Changing Directory to $HOME..."
cd $HOME;
echo "Nginx version to install: " && \
read NGINX_VERSION && \
echo "Downloading nginx-$NGINX_VERSION..." && \
wget http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz && \