Skip to content

Instantly share code, notes, and snippets.

View filipecrosk's full-sized avatar
🚀
Working remotely

Filipe Bragança filipecrosk

🚀
Working remotely
View GitHub Profile
@mikejolley
mikejolley / gist:1860056
Created February 18, 2012 16:27
WooCommerce - Override billing fields
add_filter( 'woocommerce_billing_fields', 'custom_woocommerce_billing_fields' );
function custom_woocommerce_billing_fields( $fields ) {
// Over-ride a single label
$fields['billing_first_name']['label'] = 'Your label';
// Over-ride a single required value
$fields['billing_first_name']['required'] = false;
@mikejolley
mikejolley / gist:2176823
Created March 24, 2012 00:44
WooCommerce - Show products from current product category (when viewing a single product)
<?php
if ( is_singular('product') ) {
global $post;
// get categories
$terms = wp_get_post_terms( $post->ID, 'product_cat' );
foreach ( $terms as $term ) $cats_array[] = $term->term_id;
@claudiosanches
claudiosanches / functions.php
Created December 1, 2012 20:59
WooCommerce - Custom Simple Product price format.
<?php
/**
* Custom simple product price format.
*
* Adds credit cart parcels in price html.
*
* @param string $price Old price format.
*
* @return string Price format with credit card parcels.
*/
class apt-get::update {
exec { "apt-get update":
command => "apt-get update"
}
}
@rafaelbiriba
rafaelbiriba / install_ffmpeg_libfdkaac.sh
Last active July 25, 2024 03:04
Install FFmpeg with libfdk_aac support (For Ubuntu)
# Criando um script .sh para executar todos os comandos:
#root@servidor:~# vi script.sh
#root@servidor:~# chmod +x script.sh
#root@servidor:~# ./script.sh
apt-get update
apt-get -y install autoconf automake build-essential git-core libass-dev libgpac-dev libsdl1.2-dev libtheora-dev libtool libvdpau-dev libvorbis-dev libx11-dev libxext-dev libxfixes-dev pkg-config texi2html zlib1g-dev libmp3lame-dev nasm gcc yasm && true
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git
@stevenyap
stevenyap / Capistrano 3.md
Created February 21, 2014 08:52
Capistrano 3 Setup

This guide explains the way to setup a production server using Capistrano.

Setup Capistrano on LOCAL

  • Capistrano is a development gem which assist the developer to run commands on the production server (something like a Heroku toolbelt)
  • Hence, it is installed and configured on developer's computer
# Gemfile

# Use Capistrano for deployment
$ cd /usr/src
$ wget http://nginx.org/download/nginx-1.5.10.tar.gz
$ tar xzvf ./nginx-1.5.10.tar.gz && rm -f ./nginx-1.5.10.tar.gz
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.34.tar.gz
$ tar xzvf pcre-8.34.tar.gz && rm -f ./pcre-8.34.tar.gz
$ wget http://www.openssl.org/source/openssl-1.0.1l.tar.gz
$ tar xzvf openssl-1.0.1l.tar.gz && rm -f openssl-1.0.1l.tar.gz
@nicolasembleton
nicolasembleton / restart_bluetooth.sh
Last active May 11, 2024 17:43
Restart Bluetooth Daemon on Mac OS X without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@lukemelia
lukemelia / note.txt
Created April 8, 2015 04:34
When Error: watch EMFILE strikes (OS X)
This requires `brew install jq` which is a command json query.
I got this from @krisselden
@PatrickStotz
PatrickStotz / README.md
Last active September 10, 2024 03:22
Spinning globe with glowing city markers in D3

A Spinning globe with glowing city markers in D3.

Note: This visualization constantly recalculates and reprojects the position of over 4000 markers and thus needs a lot of computation power. Older computer and mobile devices might struggle with the rendering process. Furthermore the visualization is only optimized for Chrome browsers and might look different than expected when opened in other browsers.

Inspired by Curran Kelleher's idea to plot a world map in D3 by using the GeoNames database as seen in his great Introdction to D3 video.