Skip to content

Instantly share code, notes, and snippets.

View juque's full-sized avatar

Juan Pablo Aqueveque juque

View GitHub Profile
@juque
juque / wget-snapshotpage.md
Created June 1, 2019 06:10 — forked from dannguyen/wget-snapshotpage.md
Use wget to snapshot a page and its necessary visual dependencies

Use wget to mirror a single page and its visible dependencies (images, styles)

Money graphic via State of Florida CFO Vendor Payment Search

Graphic via State of Florida CFO Vendor Payment Search (flair.myfloridacfo.com)

This is a quick command I use to snapshot webpages that have a fun image I want to keep for my own collection of WTFViz. Why not just right-click and save the image? Oftentimes, the webpage in which the image is embedded contains necessary context, such as captions and links to important documentation just incase you forget what exactly that fun graphic was trying to explain.

@juque
juque / function.php
Created March 12, 2019 14:23 — forked from swapnilshrikhande/function.php
Send mail with mailgun api by PHP CURL.
<?php
define('MAILGUN_URL', 'https://api.mailgun.net/v3/DOMAIN_NAME');
define('MAILGUN_KEY', 'KEY');
function sendmailbymailgun($to,$toname,$mailfromnane,$mailfrom,$subject,$html,$text,$tag,$replyto){
$array_data = array(
'from'=> $mailfromname .'<'.$mailfrom.'>',
'to'=>$toname.'<'.$to.'>',
'subject'=>$subject,
'html'=>$html,
@juque
juque / cheatsheet.py
Created December 20, 2018 02:24 — forked from fuyufjh/cheatsheet.py
My Python Cheatsheet
Python Cheatsheet
=================
################################ Input & Output ###############################
name = input('please enter your name: ')
print('hello,', name)
ageStr = input('please enter your age: ')
age = int(ageStr)
@juque
juque / cart-info.js
Created September 26, 2016 22:41 — forked from ismasan/cart-info.js
Collect product information for products in a Bootic cart
/* Collect product information for products in the cart
Usage:
Get all products in the cart
CartInfo.getProducts(function (products) {
// products is an array of product objects
console.log(products)
})
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
context "GET index" do
#context "POST create" do
#context "GET show" do
#context "PATCH update" do (or PUT update)
#context "DELETE destroy" do
#context "GET new" do
@juque
juque / rspec_model_testing_template.rb
Created June 14, 2016 05:09 — forked from SabretWoW/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@juque
juque / cpt-genesis.php
Created February 25, 2016 22:42 — forked from neilgee/a-cpt.php
CPT (Custom Post Type) Genesis Theme - Plugin - WordPress Example
<?php
/*
Plugin Name: Event Custom Post Type
Plugin URI: http://wpbeaches.com/create-custom-post-types-in-genesis-child-theme-in-wordpress/
Description: Custom Post Types for Event
Author: Neil Gee
Version:1
Author URI:http://wpbeaches.com
*/
<h1>{{ search_term }} | {{ products | size }} productos encontrados</h1>
{% if products.size > 0 %}
<ul class="products clearfix">
{% loop products in 'product_item' %}
</ul>
{% else %}
No hay resultados.
{% endif %}
@juque
juque / custom_add_to_cart.html
Last active August 29, 2015 14:06 — forked from ismasan/custom_add_to_cart.html
custom_add_to_cart.html
<!-- Formulario y botón "agregar al carro" en plantilla product.html.
Los data-attributes son necesarios para la API Ajax del carrito (opcional) -->
<form class="add_to_cart" action="{{ add_to_cart_url }}" method="post" data-bootic-cart-add="add" data-bootic-productId="{{ product.id }}">
<!-- si hay más de 1 variante, muéstralas en una lista -->
{% if product.variants_count > 1 %}
<h4>{{ 'activerecord.models.variant' | t }}</h4>
<ul class="variants">
<!-- primero las variantes disponibles -->
{% for variant in product.available_variants %}
<li class="bootic_variant available {% cycle 'odd', 'even' %} av-variant-{{ forloop.index }}">
require 'date'
require 'koala'
class BirthdayLiker
FACEBOOK_TOKEN = 'your_oauth_key'
BIRTHDAY_WORDS = %w(birthday bday birfday birth born)
DATE_TIME_FORMAT = '%Y-%m-%d'
def initialize(birthdate, opts={})
@api = Koala::Facebook::API.new(FACEBOOK_TOKEN)