Skip to content

Instantly share code, notes, and snippets.

View LunaCodeGirl's full-sized avatar

Luna Comerford LunaCodeGirl

View GitHub Profile
@LunaCodeGirl
LunaCodeGirl / permissions.sh
Created September 10, 2013 07:26 — forked from aristath/permissions.sh
Script to fix permissions in wordpress directory.
#!/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=root # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@LunaCodeGirl
LunaCodeGirl / Git config
Created September 10, 2013 23:55
Git initial global configuration
git config --global user.name "Your Name"
git config --global user.email your.email@example.com
@LunaCodeGirl
LunaCodeGirl / wp-config-sample.php
Created September 11, 2013 23:41
Wordpress sample config file
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information by
* visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
@LunaCodeGirl
LunaCodeGirl / addgroup
Created September 11, 2013 23:44
Unix Groups
sudo addgroup <groupname>
@LunaCodeGirl
LunaCodeGirl / adduser
Created September 12, 2013 02:22
Ubuntu adduser command.
sudo adduser <username> <groupname>
@LunaCodeGirl
LunaCodeGirl / .gitattributes
Created September 14, 2013 15:38 — forked from janten/.gitignore
.gitignore and .gitattributes for an Xcode project.
# treats your Xcode project file as a binary; prevents Git from trying to fix newlines, show in diffs, and excludes from merges
*.pbxproj -crlf -diff -merge
@LunaCodeGirl
LunaCodeGirl / git-flow feature
Last active December 23, 2015 02:49
git-flow cheat sheet. A paradigm for git management that helps manage branches and types of branches.
#May branch off from: develop
#Must merge back into: develop
#Branch naming convention: anything except master, develop, release-*, or hotfix-*
#Create Feature Branch
git checkout -b myfeature develop
@LunaCodeGirl
LunaCodeGirl / Redhand Email Script
Created September 18, 2013 05:09
A script for using in Redhand to email a photo to you when someone uses the wrong password. From http://www.soma-zone.com/RedHand/a/scripts.html
on run image
set recipientName to "Joe User"
set recipientAddress to "joe.user@mac.com"
set theSubject to "Intrusion Attempt"
set theContent to "RedHand detected an intrusion attempt: " & image
set img to POSIX path of image
tell application "Mail"
set theMessage to make new outgoing message with properties
{subject:theSubject, content:theContent, visible:true}
tell application "Mail"
set theSubject to "Subject" -- the subject
set theContent to "Content" -- the content
set theAddress to "xxx@163.com" -- the receiver
set theSignatureName to "signature_name"-- the signature name
set theAttachmentFile to "Macintosh HD:Users:moligaloo:Downloads:attachment.pdf" -- the attachment path
set msg to make new outgoing message with properties {subject: theSubject, content: theContent, visible:true}
@LunaCodeGirl
LunaCodeGirl / Save Function
Created September 18, 2013 22:40
PHP to save content from custom form fields in Wordpress.
<?php
add_action( 'save_post', 'cd_meta_box_save' );
function cd_meta_box_save( $post_id )
{
// Bail if we're doing an auto save
if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
// if our nonce isn't there, or we can't verify it, bail
if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'my_meta_box_nonce' ) ) return;