Skip to content

Instantly share code, notes, and snippets.

View DevinWalker's full-sized avatar
🌱
Coding for good

Devin Walker DevinWalker

🌱
Coding for good
View GitHub Profile
@elivz
elivz / wordpress-w3tc-site.conf
Created March 20, 2011 18:06
Nginx configuration for WordPress with W3 Total Cache plugin. See http://elivz.com/blog/single/wordpress_with_w3tc_on_nginx/
server {
# Redirect yoursite.com to www.yoursite.com
server_name yoursite.com;
rewrite ^(.*) http://www.yoursite.com$1 permanent;
}
server {
# Tell nginx to handle requests for the www.yoursite.com domain
server_name www.yoursite.com;
@jcsrb
jcsrb / gist:1081548
Created July 13, 2011 23:05
get avatar from google profiles, facebook, gravatar, twitter, tumblr
function get_avatar_from_service(service, userid, size) {
// this return the url that redirects to the according user image/avatar/profile picture
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px )
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word )
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px )
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word )
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px )
// everything else will go to the fallback
// google and gravatar scale the avatar to any site, others will guided to the next best version
@Overbryd
Overbryd / anchors_on_the_fly.diff
Created July 20, 2011 07:52
InfoBubble set anchors / position on the fly
@@ -347,6 +347,20 @@ InfoBubble.prototype.setArrowStyle = function(style) {
InfoBubble.prototype['setArrowStyle'] =
InfoBubble.prototype.setArrowStyle;
+InfoBubble.prototype.setAnchor = function(anchor) {
+ if (anchor) {
+ this.set('anchor', anchor);
+ this.bindTo('anchorPoint', anchor);
+ this.bindTo('position', anchor);
+ } else if (this.get('anchor')) {
@Rarst
Rarst / deprecated.md
Last active February 21, 2023 11:21
WordPress coding standards configuration for PhpStorm

Now Native

PhpStorm now bundles WordPress coding style natively, starting from version 8.

  1. Go to Project Settings > Code Style > PHP.
  2. Select Set From... (top right of window) > Predefined Style > WordPress.

No longer need to muck with this import! :)

# custom login link
RewriteRule ^login$ http://localhost/whitelabel/wp-login.php [NC,L]
@mikesherov
mikesherov / grunt.md
Created April 25, 2012 12:56
getting grunt to work on windows with cygwin and git

Getting grunt to work with Cygwin and git on Windows is a bit difficult considering the cygwin package that is installed by git has an outdated version of node running on it (at least that was the case in Windows XP). There are several issues to work through:

  1. Cygwin by default installs an old version of node, this was only the case in my Windows XP machine.
  2. Open Cygwin shell
  3. which node tells you where the executable is
  4. node --version tells you if it's old
  5. cd to the directory listed by which node
  6. mv node.exe node.exe.bak
  7. download node from nodejs.org and install it
  8. Node installed through installer MIGHT not update PATH to point to correct version of node installed normally.
@sosedoff
sosedoff / opentable_client.rb
Last active September 15, 2020 14:46
OpenTable API Client - Visit http://opentable.herokuapp.com for details
require "faraday"
require "faraday_middleware"
module OpenTable
class Error < StandardError ; end
module Request
API_BASE = "http://opentable.herokuapp.com"
def connection
@mikejolley
mikejolley / gist:2974310
Created June 22, 2012 18:13
WooCommerce - Set default state/country for checkout
/**
* Manipulate default state and countries
*
* As always, code goes in your theme functions.php file
*/
add_filter( 'default_checkout_country', 'change_default_checkout_country' );
add_filter( 'default_checkout_state', 'change_default_checkout_state' );
function change_default_checkout_country() {
return 'XX'; // country code
@ChromeOrange
ChromeOrange / functions.php
Created August 22, 2012 09:08
Custom Add To Cart Messages
<?php
/**
* Custom Add To Cart Messages
* Add this to your theme functions.php file
**/
add_filter( 'woocommerce_add_to_cart_message', 'custom_add_to_cart_message' );
function custom_add_to_cart_message() {
global $woocommerce;
// Output success messages
@BronsonQuick
BronsonQuick / clear_gravity_form_default_values.js
Last active September 25, 2022 08:26
Clear default values in Gravity Forms and place them back in on blur if they are empty
jQuery(document).ready(function($) {
jQuery.fn.cleardefault = function() {
return this.focus(function() {
if( this.value == this.defaultValue ) {
this.value = "";
}
}).blur(function() {
if( !this.value.length ) {
this.value = this.defaultValue;