Skip to content

Instantly share code, notes, and snippets.

user www-data;
worker_processes auto;
worker_rlimit_nofile 100000;
pid /run/nginx.pid;
events {
worker_connections 10240;
# multi_accept on;
}
@lmartins
lmartins / functions.php
Created October 29, 2014 12:29
Add menu items programatically
add_filter( 'genesis_nav_items', 'be_follow_icons', 10, 2 );
add_filter( 'wp_nav_menu_items', 'be_follow_icons', 10, 2 );
/**
* Follow Icons in Menu
* @author Bill Erickson
* @link http://www.billerickson.net/genesis-wordpress-nav-menu-content/
*
* @param string $menu
* @param array $args
* @return string
@julionc
julionc / ruby_setup.md
Last active August 18, 2017 15:24
Deploy Ruby On Rails on Ubuntu 14.04

Deploy Ruby On Rails on Ubuntu 14.04

Server: Nginx with Phusion Passenger

Ruby Version: 2.1.3

User System: deploy

User System

@lmartins
lmartins / loops.php
Created October 17, 2014 13:57
Change Add to Cart to Read More
add_filter( 'woocommerce_loop_add_to_cart_link', 'mw_change_add_to_cart_loop' );
function mw_change_add_to_cart_loop( $product ) {
global $product; // this may not be necessary as it should have pulled the object in already
return '<a class="button" href="' . esc_url( $product->get_permalink( $product->id ) ) . '">DETALHES</a>';
}
@lmartins
lmartins / front-page.php
Created October 8, 2014 08:44
WooCommerce custom loop for Featured Products
<?php
$args = array(
'post_type' => 'product',
'meta_key' => '_featured',
'meta_value' => 'yes',
'posts_per_page' => 6
);
$featured_query = new WP_Query( $args );
if ($featured_query->have_posts()) :
?>
@debloper
debloper / repel.js
Last active August 29, 2015 14:07
Lean mouseover-on-page element animator scripts
// Set the element to select; the only moving part here
// Like literally...
var elem = document.querySelector("elem")
, html = document.querySelector("html");
// Apply positioning, just in case it wasn't already
elem.style.position = "absolute";
// Take the viewport height/width into consideration
// @TODO: should be updated on window resize
@zellwk
zellwk / gist:5ddfbde0e83da3d3f9a0
Created August 29, 2014 09:12
Gruntfile for WP
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
module.exports = function(grunt) {
// load all grunt tasks
require('load-grunt-tasks')(grunt);
@shime
shime / _README.md
Last active March 15, 2021 19:26
comparing dates and times in RSpec

What is this?

How do you compare date/times in RSpec?

If you do this

expect(Time.now.to_i).to eq Time.new(2014, 4, 2).to_i
@tomfuertes
tomfuertes / config.diff
Created February 9, 2014 17:47
uncss on a rails landing page in < 15 min (initial config steps in comments)
diff --git a/Gruntfile.js b/Gruntfile.js
index 53fe849..80ce14a 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -56,6 +56,16 @@ module.exports = function (grunt) {
max_jshint_notifications: 5
}
},
+ uncss: {
+ gettingStarted: {
@leemour
leemour / FontFix RubyMine
Last active October 6, 2018 06:42
Fixing font anti-aliasing for Ubuntu.
# Change Java Runtime:
sudo update-alternatives --config java
# Delete Open-JDK
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
# Change fonts - remove hinting:
http://askubuntu.com/questions/32624/ugly-fonts-in-netbeans-how-can-i-make-it-use-the-system-font
# Change RubyMine AntiAliasing first: