Skip to content

Instantly share code, notes, and snippets.

@ezekg
ezekg / Cliref.md
Created June 5, 2016 20:26 — forked from yunga/Cliref.md
CLIRef.md
_________ _____ _______________       _____
\_   ___ \\    \\___________   \____ / ____\     ~/.bash/cliref.md
/    \  \/|    | |   ||       _/ __ \  __\    copy/paste from whatisdb
\     \___|__  |_|_  ||    |   \  __/|_ |   http://pastebin.com/yGmGiDQX
 \________  /_____ \_||____|_  /____  /_|     yunga.palatino@gmail.com
 20160515 \/ 1527 \/         \/     \/

alias CLIRef.txt='curl -s "http://pastebin.com/raw/yGmGiDQX" | less -i'

@ezekg
ezekg / ipn-test.php
Created April 22, 2016 23:42 — forked from mikejolley/ipn-test.php
Quick snippet/plugin/dropin to test IPN support
<?php
/**
* Plugin Name: PayPal Sandbox IPN Tester
* Description: Pings the IPN endpoint to see if your server can connect. Just head to <a href="/?ipn-test=1">yoursite.com/?ipn-test=1</a> whilst logged in as admin.
* Version: 1.0.0
* Author: WooThemes
* Requires at least: 4.1
* Tested up to: 4.3
*/
if ( ! defined( 'ABSPATH' ) ) {
@ezekg
ezekg / yardoc_cheatsheet.md
Created February 23, 2016 22:38 — forked from chetan/yardoc_cheatsheet.md
YARD cheatsheet

YARD CHEATSHEET http://yardoc.org

cribbed from http://pastebin.com/xgzeAmBn

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.

Modules

Namespace for classes and modules that handle serving documentation over HTTP

#!/bin/bash
# Add Vagrant's hostupdater commands to sudoers, for `vagrant up` without a password
# force sudo on self.
if [ $( id -u ) -ne 0 ]; then
exec sudo -p "Login password for %p: " "$0" "$@"
exit $?
fi
# Stage updated sudoers in a temporary file for syntax checking
@ezekg
ezekg / install_vagrant_sudoers.sh
Created January 6, 2016 15:29 — forked from GUI/install_vagrant_sudoers.sh
Allow Vagrant sudo-access without password for NFS-setup (for OS X)
#!/bin/bash
# Script for placing sudoers.d files with syntax-checking
# Making a temporary file to contain the sudoers-changes to be pre-checked
TMP=$(mktemp -t vagrant_sudoers)
cat /etc/sudoers > $TMP
cat >> $TMP <<EOF
# Allow passwordless startup of Vagrant when using NFS.
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/su root -c echo '*' >> /etc/exports
@ezekg
ezekg / gist:110f5f272df43d9519f3
Created November 3, 2015 19:29 — forked from markjaquith/gist:2653957
WordPress Fragment Caching convenience wrapper
<?php
/*
Usage:
$frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL
if ( !$frag->output() ) { // NOTE, testing for a return of false
functions_that_do_stuff_live();
these_should_echo();
// IMPORTANT
$frag->store();
// YOU CANNOT FORGET THIS. If you do, the site will break.
@ezekg
ezekg / Email-Qmail-Spam-cleanup-and-prevention.md
Created September 29, 2015 16:54 — forked from facelordgists/Email-Qmail-Spam-cleanup-and-prevention.md
TERMINAL: Email / Qmail Spam cleanup and prevention

#Qmail spam prevention:

Start Qmail

/etc/init.d/qmail start
/etc/init.d/xinetd start

Stop Qmail

/etc/init.d/qmail stop

@ezekg
ezekg / local.xml
Created September 25, 2015 14:31 — forked from Maksold/local.xml
Magento XML - local.xml boilerplate
<?xml version="1.0"?>
<layout>
<default>
<!--Root/Default Layouts-->
<reference name="root">
<!--Appending Block-->
<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>
</reference>
<!--CSS and JS Files-->
# From top comment on http://www.reddit.com/r/ruby/comments/29hr4x/whats_youre_favorite_ruby_trick_or_quirk_that/?utm_source=rubyweekly&utm_medium=email
class FakeRedditApi
def initialize
@count = 0
end
def has_next_post?
module HashExtensions
def symbolize_keys
inject({}) do |acc, (k,v)|
key = String === k ? k.to_sym : k
value = Hash === v ? v.symbolize_keys : v
acc[key] = value
acc
end
end
end