Skip to content

Instantly share code, notes, and snippets.

View ducktype's full-sized avatar
👺
Never Satisfied!

ducktype

👺
Never Satisfied!
View GitHub Profile
<?php
/*
Description: Adds a taxonomy filter in the admin list page for a custom post type.
Written for: http://wordpress.stackexchange.com/posts/582/
By: Mike Schinkel - http://mikeschinkel.com/custom-workpress-plugins
Instructions: Put this code in your theme's functions.php file or inside your own plugin. Edit to suite your post types and taxonomies. Hope this helps...
*/
add_filter('manage_listing_posts_columns', 'add_businesses_column_to_listing_list');
function add_businesses_column_to_listing_list( $posts_columns ) {
if (!isset($posts_columns['author'])) {
@mediabounds
mediabounds / floatsign.sh
Last active March 31, 2024 18:43
A small bash script to re-sign iOS applications.
# !/bin/bash
# Copyright (c) 2011 Float Mobile Learning
# http://www.floatlearning.com/
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
@jazbek
jazbek / gist:3794987
Created September 27, 2012 16:34
Allow 'post_type' passed as an arg to get_terms (useful for taxonomies shared between post types)
/**
* terms_clauses
*
* filter the terms clauses in get_terms(), allow post_type arg
*
* @param $clauses array
* @param $taxonomy string
* @param $args array
* @return array
* @author Jessica Yazbek
@stuartcarnie
stuartcarnie / clear-apc.php
Last active February 25, 2024 11:07
Self-contained php script to clear shared-memory cache in php5-fpm via command-line. In this instance it is clearing APC, but can be easily changed to clear other shared-memory caches.
#!/usr/bin/env php
<?php
/*
Copyright 2013 Stuart Carnie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
@willurd
willurd / web-servers.md
Last active November 13, 2024 13:44
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@sillygwailo
sillygwailo / extract-ios-wallpaper.md
Last active October 19, 2024 17:11
Extract your iOS wallpaper if the image is not in your Camera Roll
  1. Backup your iOS device to your computer (not iCloud) through iTunes
  2. Download iPhone / iPod Touch Backup Extractor from http://supercrazyawesome.com/
  3. Run the app, and click "Read Backups"
  4. Find the backup you just made
  5. Make an empty directory
  6. Scroll all the way down and highlight "iOS Files"
  7. Extract the iOS files to the directory you made
  8. Visit https://www.dcode.fr/cpbitmap-format
  9. Click "Choose File"
  10. Inside the directory you created, find the iOS Files/Library/Springboard directory.
@plentz
plentz / nginx.conf
Last active November 16, 2024 14:10
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@dmouse
dmouse / composer.json
Last active October 19, 2021 20:04
Run composer command from php script, controller, web,
{
"name": "hechoendrupal/composer-ui",
"description": "Composer UI",
"minimum-stability": "dev",
"authors": [
{
"name": "David Flore",
"email": "[email protected]"
}
],
@sfan5
sfan5 / cpbitmap2image.py
Created January 6, 2014 10:13
Tools to work with .cpbitmap files
#!/usr/bin/env python2
from PIL import Image
import sys
import struct
def r8(f):
return ord(f.read(1))
if len(sys.argv) <= 2:
print("Usage: %s <input> <output>" % sys.argv[0])
@morganrallen
morganrallen / _README.md
Last active January 15, 2023 19:41
Janky Browser

JankyBrowser

The only cross-platform browser that fits in a Gist!

One line install. Works on Linux, MacOSX and Windows.

Local Install

$&gt; npm install http://gist.github.com/morganrallen/f07f59802884bcdcad4a/download