Skip to content

Instantly share code, notes, and snippets.

View LunaCodeGirl's full-sized avatar

Luna Comerford LunaCodeGirl

View GitHub Profile
@LunaCodeGirl
LunaCodeGirl / examples.sh
Created September 25, 2013 23:39
Figlet how to and examples
figlet "I've got something to say"
figlet -f thick "Make Tech ASCIIer"
date | figlet -f basic
@LunaCodeGirl
LunaCodeGirl / wp-config.php
Created September 25, 2013 23:28
Wordpress updater / uploader constants to set default user, pass, key, host, etc.
define('FTP_PUBKEY','/home/user1/wp_rsa.pub');
define('FTP_PRIKEY','/home/user1/wp_rsa');
define('FTP_USER','user1');
define('FTP_PASS','');
define('FTP_HOST','127.0.0.1:22');
{
"cmd": ["bash", "-c", "clang -lobjc -framework Cocoa -framework Carbon -o /tmp/sublime-objc-output $file"],
"file_regex": "^(.*?):([0-9]+):([0-9]+): (.*)",
"selector": "source.objc",
"variants": [
{
"name": "Run",
"cmd": ["bash", "-c", "clang -lobjc -framework Cocoa -framework Carbon -o /tmp/sublime-objc-output $file && /tmp/sublime-objc-output"]
}
]
@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;
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 / 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}
@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 / .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 / adduser
Created September 12, 2013 02:22
Ubuntu adduser command.
sudo adduser <username> <groupname>
@LunaCodeGirl
LunaCodeGirl / addgroup
Created September 11, 2013 23:44
Unix Groups
sudo addgroup <groupname>