Skip to content

Instantly share code, notes, and snippets.

View eliasfaical's full-sized avatar
🏠
Working from home

Elias Faiçal eliasfaical

🏠
Working from home
View GitHub Profile
@jcemer
jcemer / code.scss
Last active December 26, 2015 09:29
.section-title {
font-size: rem(28px);
color: $blue;
@include inverse-bottom-line(80%);
}
.collaborate-item:last-child {
@include left-line(90%);
padding-left: 10%;
}

.address-map {
@vitorbritto
vitorbritto / commands.md
Last active June 9, 2016 12:44
Unix References

Unix Commands

Environment Control

cd d                         Change to directory d
mkdir d                      Create new directory d
rmdir d                      Remove directory d
mv f1 [f2...] d              Move file f to directory d
mv d1 d2                     Rename directory d1 as d2

passwd Change password

@pablo-sg-pacheco
pablo-sg-pacheco / functions.php
Last active November 24, 2016 01:29
Replaces product price by out of stock message in case a variable product is out of stock (Woocommerce)
<?php
//Replaces product price by out of stock message in case a variable product is out of stock (optional)
add_action('woocommerce_before_single_product_summary',function(){
if(is_product()){
global $product;
if(!$product->is_in_stock()){
remove_action('woocommerce_single_variation','woocommerce_single_variation');
remove_action('woocommerce_single_product_summary','woocommerce_template_single_price');
add_action('woocommerce_single_product_summary',function(){
?>
@pablo-sg-pacheco
pablo-sg-pacheco / functions.php
Last active November 24, 2016 01:29
Shows out of stock message when a variable product has all variations out of stock
<?php
//Shows out of stock message when a variable product has all variations out of stock
add_filter('wp_footer', function(){
if(is_product()){
global $product;
if($product->is_type('variable')){
if(!$product->is_in_stock()){
?>
<script>
jQuery(window).load(function(){
@nolim1t
nolim1t / home.jade
Created May 11, 2012 05:19
Sample Templating with express and jade
h2 Hello World
h3 Hello World
:markdown
This is some **test** markdown text
we can even link to [stuff](http://google.com)
ul.list
- each i in data
li=i.name
@jameskoster
jameskoster / functions.php
Last active July 7, 2017 23:43
WooCommerce - dequeue css (2.1+)
// Remove each style one by one
add_filter( 'woocommerce_enqueue_styles', 'jk_dequeue_styles' );
function jk_dequeue_styles( $enqueue_styles ) {
unset( $enqueue_styles['woocommerce-general'] ); // Remove the gloss
unset( $enqueue_styles['woocommerce-layout'] ); // Remove the layout
unset( $enqueue_styles['woocommerce-smallscreen'] ); // Remove the smallscreen optimisation
return $enqueue_styles;
}
// Or just remove them all in one line
@danilowm
danilowm / gist:bb6f216dd018ae68a803
Created May 13, 2014 13:16
web.config wordpress em hospedagem Windows
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Main Rule" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
@gyrus
gyrus / gist:3155982
Created July 21, 2012 14:40
Rename WordPress "Posts" to "News"
<?php
/**
* Rename "Posts" to "News"
*
* @link http://new2wp.com/snippet/change-wordpress-posts-post-type-news/
*/
add_action( 'admin_menu', 'pilau_change_post_menu_label' );
add_action( 'init', 'pilau_change_post_object_label' );
function pilau_change_post_menu_label() {
@apathetic
apathetic / gist:3648737
Created September 6, 2012 00:31
Wordpress: add radio button to admin Users table
/*
* Add a column to the Users table, with a radio button
* The radio button updates a usermeta field via ajax
*/
add_filter( 'manage_users_columns', 'add_display_column');
function add_display_column( $columns){
$columns['display_as'] = 'Display as';
return $columns;
}
add_filter( 'the_content', 'post_love_display', 99 );
function post_love_display( $content ) {
$love_text = '';
if ( is_single() ) {
$love = get_post_meta( get_the_ID(), 'post_love', true );
$love = ( empty( $love ) ) ? 0 : $love;
$love_text = '<p class="love-received"><a class="love-button" href="#" data-id="' . get_the_ID() . '">give love</a><span id="love-count">' . $love . '</span></p>';