Skip to content

Instantly share code, notes, and snippets.

View juanpabloprado's full-sized avatar
🛖
Working From Hut

Juan Pablo Prado juanpabloprado

🛖
Working From Hut
View GitHub Profile
@juanpabloprado
juanpabloprado / RoundedCornersTransform.java
Last active February 20, 2016 00:47
RoundedCornersTransform for Picasso
/*
* Copyright 2016 Juan Pablo Prado
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/*
* Copyright 2016 Juan Pablo Prado
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
package com.juanpabloprado.util;
import android.app.ActivityManager;
import android.content.ComponentName;
import android.content.Context;
import android.os.Build;
import java.util.List;
public class NotificationUtils {
package com.juanpabloprado.ui.activity;
import android.app.ProgressDialog;
import android.support.v7.app.AppCompatActivity;
public abstract class ActivityWithProgressDialog extends AppCompatActivity {
private ProgressDialog mProgressDialog;
public void showProgressDialog() {
@juanpabloprado
juanpabloprado / .bashrc
Created August 22, 2016 00:00
Pretty git log alias
alias gl='git log --oneline --all --graph --decorate $*'
#!/bin/bash
cd /var/www/html
NOW=$(date +%Y%m%d)
SQL_FILE=${NOW}_database.sql
# Backup database
wp db export ../backups/$SQL_FILE --add-drop-table
@juanpabloprado
juanpabloprado / nginx.conf
Created October 8, 2016 22:13 — forked from A5hleyRich/nginx.conf
Hosting WordPress Yourself Part 1 – Installing Nginx, PHP and MySQL
user ashley;
worker_processes 1;
pid /run/nginx.pid;
events {
worker_connections 1024;
multi_accept on;
}
http {
wp core download --locale=es_MX
wp core config --dbname=site_com --dbuser=site --dbpass=password --dbhost=localhost
wp core install --url=https://site.com --title="Site" --admin_name=site_@dm1n --admin_email=juan@juanpabloprado.com --admin_password=password
@juanpabloprado
juanpabloprado / exp-month.html
Created December 27, 2018 05:23
Expiration month snippet
<select class="custom-select form-control" id="exp-month">
<option value="1">1 - January</option>
<option value="2">2 - February</option>
<option value="3">3 - March</option>
<option value="4">4 - April</option>
<option value="5">5 - May</option>
<option value="6">6 - June</option>
<option value="7">7 - July</option>
<option value="8">8 - August</option>
<option value="9">9 - September</option>
@juanpabloprado
juanpabloprado / cc.html
Last active February 18, 2019 19:53
Grid code snippet
<div class="form-row">
<div class="col-lg-6 form-group">
<label for="cc-num">Card Number:</label>
<input class="form-control" id="cc-num" type="text">
</div>
<div class="col-lg form-group">
<label for="zip">Zip Code:</label>
<input class="form-control" id="zip" type="text">
</div>