Skip to content

Instantly share code, notes, and snippets.

<?php
/*
* Formats an array so that it can be copied and pasted directly as a PHP variable
*
* $arr => The input array
* $varname => Optional. Example, '$foo' will prefix return with '$foo = '
* $output => 'pre' (default) outputs with a <pre> tag. true outputs, false returns a string
* $recursing => Used internally for recursion
*/
sudo update-rc.d -f apache2 remove
sudo update-rc.d -f mysql remove
#!/bin/sh
#
# Example showing use of getopt detection and use of GNU enhanced getopt
# to handle arguments containing whitespace.
#
# Written in 2004 by Hoylen Sue <hoylen@hoylen.com>
#
# To the extent possible under law, the author(s) have dedicated all copyright and
# related and neighboring rights to this software to the public domain worldwide.
# This software is distributed without any warranty.
@groovenectar
groovenectar / example.html
Last active August 29, 2015 14:21
jquery.searchify.js
<!doctype html>
<html>
<title>jquery.searchify.js</title>
<link rel="stylesheet" href="style.css">
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="jquery.searchify.js"></script>
<style type="text/css">
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
@groovenectar
groovenectar / SassMeister-input.scss
Created June 19, 2015 02:47
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$steel: #666666;
footer {
.disclaimers,
.copyright {
color: $steel;
<?php
// Add tag_slug__not_in to valid taxonomy queries
add_action('parse_tax_query', function($wp_query) {
$q = &$wp_query->query_vars;
$tax_query = array();
if (!empty($q['tag_slug__not_in'])) {
$q['tag_slug__not_in'] = array_map('sanitize_title_for_query', array_unique((array)$q['tag_slug__not_in']));
$tax_query[] = array(
@groovenectar
groovenectar / 1px-transparent-png-base64.txt
Created November 17, 2015 19:23
1px transparent png base64
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=
@groovenectar
groovenectar / How Do I Like?
Last active December 22, 2015 04:58
Bookmarklet, removes Like buttons on a Facebook page
<a href="javascript:
(function() {
var elems = document.getElementsByClassName( 'UFILikeLink' );
for ( var i = 0; i < elems.length; i++ ) {
if ( elems[i].style.display == 'none' ) {
elems[i].style.display = 'inline-block';
} else {
elems[i].style.display = 'none'
}
@groovenectar
groovenectar / http-auth.php
Created June 16, 2016 21:30
Updated HTTP Auth plugin for Wordpress -- https://wordpress.org/plugins/http-auth/
<?php
/*
Plugin Name: Http Auth
Plugin URI: https://wordpress.org/plugins/http-auth/
Description: This plugin allows you apply HTTP Auth on your site. You can apply Http Authentication all over the site or only the admin pages.
Version: 0.1
Author: Sami Ahmed Siddiqui and Yasir Ahmed Siddiqui
Author URI: http://www.yasglobal.com
Text Domain: http-auth
*/
@groovenectar
groovenectar / .gitignore
Last active October 10, 2016 15:54 — forked from erfanimani/.gitignore
A refactored and modern .gitignore for Magento. Compatible for Git versions 2.7.0+. See this revision to use it for versions lower than 2.7.0: https://gist.github.com/erfanimani/8856964/886f5d79d229c21b9c712155c362e5fc1c61a12a
### MAGENTO DIRECTORIES
# Ignore everything in media, except for the htaccess files
# Also include the Lazy Catalog Images (LCI) .htaccess if that's installed
# (https://github.com/AOEpeople/Aoe_LazyCatalogImages)
/media/*
!/media/.htaccess
!/media/customer/.htaccess
!/media/downloadable/.htaccess
!/media/catalog/product/LCI/.htaccess