Skip to content

Instantly share code, notes, and snippets.

@allekmott
allekmott / MineHelper.md
Last active July 21, 2017 21:02
MineHelper

MineHelper

Shell script CudaMiner helper. Hopes to provide simplicity of initializing mining jobs and monitoring them across different machines.

Support

  • Works flawlessly with GTX 660Ti Reference
  • No dual-GPU support yet; if demanded, will supply
@Shelob9
Shelob9 / 1-pods-loop-general-example.php
Last active April 14, 2023 12:23
Pods Looping Examples.
<?php
//set up pods::find parameters to limit to 5 items
$param = array(
'limit' => 5,
);
//create pods object
$pods = pods('pod_name', $params );
//check that total values (given limit) returned is greater than zero
if ( $pods->total() > 0 ) {
@ncserny
ncserny / Varnish Redirect Old URLs To New Domain
Last active December 25, 2015 17:39
Varnish: Easily redirect "olddomain.com/..." to "newdomain.com/..." URLs at the cache level.
# Redirect "olddomain.com/..." to "newdomain.com/..." URLs at the cache level.
# Just set an error code (in our case 750) in vcl_recv when accessing old urls, then define the redirect in vcl_error.
# Tested with Varnish 3.X
sub vcl_recv {
# Set error code when accessing an old url.
if (req.http.host ~ "^(www\.)?olddomain\.com$") {
error 750;
}
}
@jdevalk
jdevalk / gist:5623050
Created May 21, 2013 20:39
Redirect script sample NGINX code. Make sure this location line sits above the "location /" code in your NGINX config.
location /redirect/ {
rewrite ^/redirect/(.*)$ /redirect/index.php?id=$1 last;
}
@isGabe
isGabe / get-highlight-terms.php
Last active February 12, 2022 16:22
WordPress: Output a list of taxonomy terms, then highlight the terms the belong to the current post. Updated to use in_array() to add a "current" CSS class to terms that the current post has. This way we don't have to worry about keeping up with terms in the CSS. Hooray for logic! #snippet #WordPress
<?php
/*
As the title implies, this will give you a way to
1. output a complete list of terms for a given taxonomy (nothing special there)
2. highlight the terms that the current post has (the magic!)
Probably need to figure out a better way to echo out the url of the term archive page...
*/