Skip to content

Instantly share code, notes, and snippets.

View darwing1210's full-sized avatar

Darwing Medina darwing1210

  • Handraise
  • Austin, TX
  • 19:01 (UTC -04:00)
  • LinkedIn in/dmedina93
View GitHub Profile
@ericrobskyhuntley
ericrobskyhuntley / README.md
Last active March 22, 2020 00:26 — forked from rgdonohue/README.md
Batch Geocoding Script with GeoPy
@mannieschumpert
mannieschumpert / gist:8886289
Last active August 2, 2020 13:15
Code Examples from Andrew Nacin's "Current User Can Watch This Talk"
<?php
// If you can edit pages, you can edit widgets
add_filter( 'user_has_cap',
function( $caps ) {
if ( ! empty( $caps['edit_pages'] ) )
$caps['edit_theme_options'] = true;
return $caps;
} );
@kloon
kloon / functions.php
Last active November 26, 2020 02:21
WooCommerce set tax exemption based on user role
<?php
add_filter( 'init', 'wc_tax_exempt_user_roles' );
function wc_tax_exempt_user_roles() {
if ( ! is_admin() ) {
global $woocommerce;
if ( current_user_can('wholesaler') || current_user_can('distributor') ) {
$woocommerce->customer->set_is_vat_exempt(true);
} else {
$woocommerce->customer->set_is_vat_exempt(false);
}
Canal 2: http://138.117.4.70:8079/streams/d/Canal-2/playlist.m3u8
Canal 4: http://138.117.4.70:8079/streams/d/Canal-4/playlist.m3u8
Canal 6: http://138.117.4.70:8079/streams/d/Canal-6/playlist.m3u8
Canal 8: http://138.117.4.70:8079/streams/d/Canal-25/playlist.m3u8
Canal 9: http://138.117.4.70:8079/streams/d/Canal-9/playlist.m3u8
Canal 10: http://138.117.4.70:8079/streams/d/Canal-10/playlist.m3u8
Canal 11: http://138.117.4.70:8079/streams/d/Canal-11/playlist.m3u8
Canal 12: http://138.117.4.70:8079/streams/d/Canal-12/playlist.m3u8
Canal 13: http://138.117.4.70:8079/streams/d/Canal-13/playlist.m3u8
Canal 15: http://138.117.4.70:8079/streams/d/Canal-15/playlist.m3u8
@int-ua
int-ua / import_file.py
Created December 28, 2017 19:38
Import management command for django-import-export
# https://gist.github.com/bmihelac/434fceb6ba8e752f08d3
# https://github.com/django-import-export/django-import-export/issues/332
from __future__ import unicode_literals
import mimetypes
from django.core.management.base import BaseCommand, CommandError
from django.utils import termcolors
from django.utils.encoding import force_text
@mrkdevelopment
mrkdevelopment / In your social icons file
Last active July 29, 2022 00:25
Divi social icons extension
<?php if ( 'on' === et_get_option( 'divi_show_linkedin_icon', 'on' ) ) : ?>
<li class="et-social-icon et-social-linkedin">
<a href="<?php echo esc_url( et_get_option( 'divi_linkedin_url', '#' ) ); ?>" class="icon">
<span><?php esc_html_e( 'Linked In', 'Divi' ); ?></span>
</a>
</li>
<?php endif; ?>
<?php if ( 'on' === et_get_option( 'divi_show_youtube_icon', 'on' ) ) : ?>
<li class="et-social-icon et-social-youtube">
@eliangcs
eliangcs / pyenv+virtualenv.md
Last active June 8, 2023 07:46
Cheatsheet: pyenv, virtualenvwrapper, and pip

Cheatsheet: pyenv, virtualenvwrapper, and pip

Installation (for Mac OS)

Install pyenv with brew

brew update
brew install pyenv
@nrollr
nrollr / MySQL_macOS_Sierra.md
Last active January 31, 2024 14:45
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@bsweger
bsweger / useful_pandas_snippets.md
Last active April 19, 2024 18:04
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

@macbleser
macbleser / wp-permissions-script
Created February 21, 2014 15:37
WordPress Permissions Configuration Script
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro
#
WP_OWNER=changeme # &lt;-- wordpress owner
WP_GROUP=changeme # &lt;-- wordpress group
WP_ROOT=/home/changeme # &lt;-- wordpress root directory