Skip to content

Instantly share code, notes, and snippets.

View haveboard's full-sized avatar

haveboard haveboard

View GitHub Profile
@redoPop
redoPop / .gitignore
Created June 18, 2010 22:08
Template .gitignore file for WordPress projects
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@Integralist
Integralist / bootstrap.css
Created November 24, 2011 14:16
List of Twitter Bootstrap CSS classes
/*
* Scaffolding
* Basic and global styles for generating a grid system, structural layout, and page templates
* ------------------------------------------------------------------------------------------- */
.container
Sets a width of 940px which also centres the content (clears floated elements before/after)
.container-fluid
Sets a minimum width of 940px (clears floated elements before/after)
@visualkom
visualkom / CSS Image Replacement
Last active December 5, 2019 15:58
[New CSS Image Replacement] (Jeffrey Zeldman blog post) #css
.hide-text {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
@uson1x
uson1x / hack.sh
Last active June 6, 2024 07:41 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2275613/hack.sh | sh
#
@bueltge
bueltge / author-filter-meta-box.php
Created August 1, 2012 11:27
Add a meta box to WordPress edit posts and list only authors
<?php
/**
* Plugin Name: Author Meta Box only with authors
* Plugin URI: http://wordpress.stackexchange.com/questions/60429/stop-loading-collaborators-users-on-add-new-post-or-page
* Description:
* Author: Frank Bültge
* Author URI: http://bueltge.de
* License: GPLv3
*/
add_action( 'admin_menu', 'fb_remove_author_meta_boxes' );
@Adirael
Adirael / fix-wordpress-permissions.sh
Created August 17, 2012 23:16
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@SubZane
SubZane / Asset.php
Created August 27, 2012 14:55
WordPress: get_attachment_id_from_src
function get_attachment_id_from_src ($src) {
global $wpdb;
$reg = "/-[0-9]+x[0-9]+?.(jpg|jpeg|png|gif)$/i";
$src1 = preg_replace($reg,'',$src);
if($src1 != $src){
$ext = pathinfo($src, PATHINFO_EXTENSION);
$src = $src1 . '.' .$ext;
}
$query = "SELECT ID FROM {$wpdb->posts} WHERE guid='$src'";
$id = $wpdb->get_var($query);
@iolloyd
iolloyd / Spot the Hijack
Created September 2, 2012 20:09
Use Audio Hijack Pro to record Spotify tracks while you listen
* Script to record and tag spotify tracks, by Lloyd Moore *)
(* Make sure you are already recording in Audio Hijack Pro with a session called 'spotifySession' *)
tell application "Spotify"
set currentTrack to (current track)
set trackName to (name of currentTrack)
tell application "Audio Hijack Pro"
set theSession to my getSession()
end tell
repeat
@petenelson
petenelson / admin_head_post_edit_check.php
Created November 1, 2012 17:03
WordPress admin action hooks for listing/adding/editing posts or pages
/* actions fired when listing/adding/editing posts or pages */
/* admin_head-(hookname) */
add_action( 'admin_head-post.php', 'admin_head_post_editing' );
add_action( 'admin_head-post-new.php', 'admin_head_post_new' );
add_action( 'admin_head-edit.php', 'admin_head_post_listing' );
function admin_head_post_editing() {
echo 'you are editing a post';
}
# Variables to replace in urls below
username = 'your_username_here_without_at_symbol'
key = 'public_key_from_dev'
application_token = 'very_long_application_token'
# This needs to be parsed as JSON for all of the 'id' fields. These are the board_hashes
url_for_board_hashes = "https://api.trello.com/1/members/#{username}/boards?&key=#{key}&token=#{application_token}"
#
# Loop over each board_hash and call the following url