Skip to content

Instantly share code, notes, and snippets.

View victoraguilarc's full-sized avatar
🧭
Working

Victor Aguilar C. victoraguilarc

🧭
Working
View GitHub Profile
@victoraguilarc
victoraguilarc / rails-4-djangonauts.md
Last active May 22, 2019 19:21
cheatsheets for django developers that for any reason uses rails

COMMAND LINE GENERATOR

CREATE A RESOURCE

rails generate scaffold Post name:string title:string content:text

GENERATE MODELS

rails generate model Post title:string body:text published:boolean
def clean_inactive_devices(f):
"""
This turns as inactive to the unused devices
"""
@wraps(f)
def decorated(*args, **kwargs):
# process anythin BEFORE
results, device_tokens = f(*args, **kwargs)
# process anythin AFTER
@victoraguilarc
victoraguilarc / GitHub-Forking.md
Created January 15, 2019 06:32 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@victoraguilarc
victoraguilarc / README.md
Created October 12, 2018 22:42 — forked from superseb/README.md
Deploy kubernetes-dashboard on Rancher 2.0 cluster exposed using NodePort

Deploy kubernetes-dashboard on Rancher 2.0 cluster exposed using NodePort

Requirements

Step 1: Generate kubeconfig from the UI

Generate the kubeconfig file for your cluster using the Kubeconfig File button in the Cluster view of your cluster. Save the generated file as $HOME/.kube/config and run kubectl get nodes to verify it works.

@victoraguilarc
victoraguilarc / wordpress-apache.conf
Created July 6, 2018 17:58
Apache wordpress config
<VirtualHost *:80>
ServerName DOMAIN
ServerAdmin support@xiberty.com
DocumentRoot /var/www/PROJECT_FOLDER
ServerAlias www.DOMAIN
<Directory /var/www/PROJECT_FOLDER/>
Options +FollowSymlinks
AllowOverride All
Require all granted
@victoraguilarc
victoraguilarc / angular-nginx.conf
Last active July 6, 2018 21:27
Static Site nginx config
server {
listen 80;
root /var/www/angular.xiberty.com/dist;
index index.php index.html index.htm;
server_name angular.xiberty.com;
access_log /var/www/angular.xiberty.com/nginx-access.log;
error_log /var/www/angular.xiberty.com/nginx-error.log;
@victoraguilarc
victoraguilarc / nginx.conf
Created July 6, 2018 17:50
Static Site nginx config
server {
listen 80;
root path/to/site;
index index.php index.html index.htm;
server_name DOMAIN;
access_log path/to/site/var/log/nginx-access.log;
error_log path/to/site/var/log/nginx-error.log;
@victoraguilarc
victoraguilarc / EvenstFragment.java
Created May 17, 2018 15:55
VMP for TAb layout Fragment Android
package com.xiberty.jiwaki.agenda.fragments.events;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
@victoraguilarc
victoraguilarc / Git_bash_commands.md
Last active July 18, 2019 13:52
Agregar comandos a Git Bash

Como agregar más comandos a Git Bash on Windows

Git for Windows viene por defecto con "Git Bash" esta terminal tiene las utilidades más comunes de Linux, sin embargo no tiene todos los comandos, pero es muy sencillo agregar nuevos comandos obviamente simpre que haya un binario instalador del comando para Windows.

La idea es basicamente es el directorio C:\Program Files\Git\mingw64\ es tu directorio raiz / para Git Bash (Nota: dependerá de como lo hayas instalado, el directorio podríá ser diferente. Dale click derecho en el icono de Git Bash y abre la ubicacion del archivo para saber la ruta de instalación. Find it by using pwd -W). Ya en la carpeta mingw64 encontraras una estructura similar a la estructura de carpetas de linux (bin, etc, lib, etc).

Para instalar alguna utilidad, por ejemplo wget, deberas descargar el binario de esta utilidad, renombrarla con el nombre del comando en este caso wget.exe y copiarla dentro de la carpeta bin en

@victoraguilarc
victoraguilarc / prestashop-nginx.conf
Last active March 24, 2020 10:31
NGINX Configuration for Prestashop 1.7.3, its works fully
server {
charset utf-8;
#listen <YOUR_IP>:80;
server_name <YOUR_DOMAIN> www.<YOUR_DOMAIN>;
root /PATH/TO/YOUR/PRESTASHOP/INSTALLATION;
index index.php;
access_log /var/log/nginx/domains/<YOUT_DOMAIN>.log combined;