Skip to content

Instantly share code, notes, and snippets.

View sejas's full-sized avatar
🐋
Set of synapses weights and biases

Antonio Sejas sejas

🐋
Set of synapses weights and biases
View GitHub Profile
@sejas
sejas / bau_woocommerce.php
Created February 9, 2016 20:51
Add new tabs with the content of Advanced Custom Fields.
<?php
/**
* Add new tabs with the content of Advanced Custom Fields.
*/
add_filter( 'woocommerce_product_tabs', 'bau_woo_remove_product_tabs', 98 );
function bau_woo_remove_product_tabs( $tabs ) {
// Define, the meta_key of the
$bautabs = array(
'alergenos' => array(
'title' => __('Alérgenos'),
@sejas
sejas / functions.php
Created February 24, 2016 11:04 — forked from WPprodigy/functions.php
Remove the password strength meter from WooCommerce checkout
function wc_ninja_remove_password_strength() {
if ( wp_script_is( 'wc-password-strength-meter', 'enqueued' ) ) {
wp_dequeue_script( 'wc-password-strength-meter' );
}
}
add_action( 'wp_print_scripts', 'wc_ninja_remove_password_strength', 100 );
@sejas
sejas / add-checkbox-to-checkout-woocommerce-functions.php
Last active April 19, 2016 15:20 — forked from thegdshop/gist:3171026
WooCommerce - Add checkbox field to the checkout
<?php
/**
* Add checkbox field to the checkout
**/
$myCheckboxKey = 'my_checkbox';
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field');
function my_custom_checkout_field( $checkout ) {
@sejas
sejas / gitbranch
Last active April 27, 2016 14:17
Git branches tutorial
# Start a new feature
git checkout -b new-feature master
# Edit some files
git add <file>
git commit -m "Start a feature"
# Merge in the new-feature branch
git checkout master
git merge new-feature
@sejas
sejas / Linux
Last active June 24, 2016 17:54
# Ban an IP Attack
iptables -A INPUT -s 191.96.249.53 -j DROP
@sejas
sejas / free shipping to europe 150+
Created September 12, 2016 11:43
free shipping to europe 150+ woocommerce
array(
array(
672037005 => array(
"condition" => "subtotal",
"operator" => ">=",
"value" => "150"
),
672037010 => array(
"condition" => "country",
"operator" => "==",
@sejas
sejas / install_caffe.sh
Created January 22, 2017 01:13 — forked from doctorpangloss/install_caffe.sh
Installing Caffe on Mac 10.11.5 and later in the 10.11 series, and 10.12.1 and later in the 10.12 series
#!/bin/sh
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Apple hides old versions of stuff at https://developer.apple.com/download/more/
# Install the latest XCode (8.0).
# We used to install the XCode Command Line Tools 7.3 here, but that would just upset the most recent versions of brew.
# So we're going to install all our brew dependencies first, and then downgrade the tools. You can switch back after
# you have installed caffe.
# Install CUDA toolkit 8.0 release candidate
# Register and download from https://developer.nvidia.com/cuda-release-candidate-download
@sejas
sejas / latido.css
Last active February 17, 2017 15:28
Animaciones CSS
.latido {
-moz-animation: latir 2s infinite;
-webkit-animation: latir 2s infinite;
animation: latir 2s infinite; }
/*$animation_first: translateY(0);*/
/*$animation_first: translateY(0);*/
/*$animation_second: translateY(-20px);*/
/*$animation_second: translateY(-20px);*/
public void onClickOpenAddressButton(View v) {
String addressString = "plaza mayor 1, Madrid";
Uri.Builder builder = new Uri.Builder();
builder.scheme("geo")
.path("0,0")
.query(addressString);
Uri addressUri = builder.build();
showMap(addressUri);
}
@sejas
sejas / functions.php
Created April 26, 2017 19:39
filter to modify oembed wordpress youtube video parameters
<?php
//If you have installed jetpack, you need to add this filter.
/* $html example value:
<span class="embed-youtube" style="text-align:center; display: block;"><iframe class='youtube-player' type='text/html' width='1220' height='717' src='http://www.youtube.com/embed/ZuYCXwcCNqM?version=3&#038;rel=1&#038;fs=1&#038;autohide=2&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' allowfullscreen='true' style='border:0;'></iframe></span>
*/
function bau_video_embed_html( $html ) {
if(strpos($html, 'youtube')!= FALSE) {
$args = [
'rel' => 0,