Skip to content

Instantly share code, notes, and snippets.

💭
here

José Luis Cruz joseluis

💭
here
View GitHub Profile
@joseluis
joseluis / playground.rs
Last active Apr 13, 2019 — forked from rust-play/playground.rs
abstracting over fields with trait abuses: reddit.com/r/rust/comments/bc2w4m/announcing_rust_1340/eks8tq5/?context=3
View playground.rs
trait Field {
type ValueType;
}
use std::marker::PhantomData as Marker;
struct X<T>(Marker<T>);
struct Y<T>(Marker<T>);
struct Z<T>(Marker<T>);
View import_json_appsscript.js
// import_json_appsscript.js
// https://gist.github.com/allenyllee/c764c86ed722417948fc256b7a5077c4
//
// Changelog:
// (Jul. 16 2018) tag: allenyllee-20180716
// 1. Fixed the issue "If you try to query /arrayA[k]/arrayB[n]/arrayC[m]/.../member, you will always get /arrayA[k]/arrayB[k]/arrayC[k]/.../member."
// (Nov. 30 2017) tag: allenyllee-20171130
// 1. Add the ability to query array elements by using xpath like "/array[n]/member" where "n" is array index
// 2. Fixed Issue: when the path and the rule partially matched but not under the same xpath, it will still print that value under that xpath.
View MemoCashClient
#!/usr/bin/env python
import asyncio
import websockets
import binascii
import ujson as json
method_map = {
'6d01': 'Set Name',
'6d02': 'Post Memo',
@joseluis
joseluis / README.md
Created Nov 14, 2017 — forked from obihann/README.md
Two Python scripts to help RES (Reddit Enhancement Suite) users manage their backups and convert between platforms.
View README.md
@joseluis
joseluis / functions.php
Created May 4, 2017 — forked from jameskoster/functions.php
WooCommerce - Remove product data tabs
View functions.php
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
function woo_remove_product_tabs( $tabs ) {
unset( $tabs['description'] ); // Remove the description tab
unset( $tabs['reviews'] ); // Remove the reviews tab
unset( $tabs['additional_information'] ); // Remove the additional information tab
return $tabs;
@joseluis
joseluis / uuid.sh
Created Feb 8, 2017 — forked from markusfisch/uuid.sh
Generate a random UUID in bash
View uuid.sh
#!/usr/bin/env bash
# Generate a pseudo UUID
uuid()
{
local N B C='89ab'
for (( N=0; N < 16; ++N ))
do
B=$(( $RANDOM%256 ))
@joseluis
joseluis / commitstrip-dl
Last active Apr 15, 2019
download all the commitstrip strips
View commitstrip-dl
#!/usr/bin/env bash
#
# name : commitstrip-dl
# description : download all the commitstrip strips
# version : 1.0.0
# author : José Luis Cruz © 2017
# dependencies: bash<=4 curl [sxiv]
# license : MIT
#
@joseluis
joseluis / meta-tags.md
Created Jan 24, 2017 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link Tags
View meta-tags.md

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@joseluis
joseluis / gist:a1e602455c3f52d7ccced81cf8df68d0
Created Oct 20, 2016 — forked from amdrew/gist:9313218
Easy Digital Downloads - Show user's purchase history as dashboard widget
View gist:a1e602455c3f52d7ccced81cf8df68d0
<?php
/**
* Register the dasboard widget
*/
function sumobi_edd_register_dashboard_widgets() {
wp_add_dashboard_widget( 'sumobi_edd_purchase_history', __( 'Purchase History', 'edd' ), 'sumbi_edd_purchase_history_widget' );
}
add_action( 'wp_dashboard_setup', 'sumobi_edd_register_dashboard_widgets' );
You can’t perform that action at this time.