This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#============================================================================== | |
#TITLE: mysql_backup.sh | |
#DESCRIPTION: script for automating the daily mysql backups on development computer | |
#AUTHOR: tleish | |
#DATE: 2013-12-20 | |
#VERSION: 0.4 | |
#USAGE: ./mysql_backup.sh | |
#CRON: | |
# example cron for daily db backup @ 9:15 am |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# These rules are designed to be effective versus /distributed/ brute force | |
# attacks. While they will function just as well against attacks which are | |
# /not distributed/ they will deny access to all XML-RPC method calls | |
# namespaced with the prefix "wp." | |
# | |
# An IP-based version of these rules may be more appropriate for sites which | |
# attacked from just a few distinct IP addresses. | |
# | |
# See http://alzabo.io/modsecurity/2014/09/15/wordpress-xml-rpc-brute-force.html | |
# for additional information |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url_sq : s small square 75x75 | |
url_q : q large square 150x150 | |
url_t : t thumbnail, 100 on longest side | |
url_s : m small, 240 on longest side | |
url_n : n small, 320 on longest side | |
url_m : - medium, 500 on longest side | |
url_z : z medium 640, 640 on longest side | |
url_c : c medium 800, 800 on longest side† | |
url_l : b large, 1024 on longest side* | |
url_o : o original image, either a jpg, gif or png, depending on source format |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)mouseDown:(NSEvent*)event | |
{ | |
//create a NSPasteboardItem | |
NSPasteboardItem *pbItem = [NSPasteboardItem new]; | |
[pbItem setDataProvider:self forTypes:[NSArray arrayWithObjects:NSPasteboardTypeTIFF, nil]]; | |
//create a new NSDraggingItem with our pasteboard item. | |
NSDraggingItem *dragItem = [[NSDraggingItem alloc] initWithPasteboardWriter:pbItem]; | |
NSPoint dragPosition = [self convertPoint:[event locationInWindow] fromView:nil]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
// Licensed under MIT (http://opensource.org/licenses/MIT) | |
// | |
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
// PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit. | |
#import <objc/runtime.h> | |
#import <objc/message.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "NSString+template.h" | |
@implementation NSString (template) | |
+(NSString*)stringWithTemplate:(NSString*)template | |
fromMap:(NSDictionary*)map | |
{ | |
NSString* retStr = nil; | |
NSMutableString* buffer = [NSMutableString new]; | |
NSScanner* scanner = [[NSScanner alloc] initWithString:template]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require("postmark.php"); | |
$postmark = new Postmark("your-api-key","from-email","optional-reply-to-address"); | |
$result = $postmark->to("[email protected]") | |
->subject("Email Subject") | |
->plain_message("This is a plain text message.") | |
->attachment('File.pdf', base64_encode(file_get_contents('sample.pdf')), 'application/pdf') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface NSDictionary (QueryStringBuilder) | |
- (NSString *)queryString; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Unserialize (to) form plugin - by Christopher Thielen | |
// adapted and desuckified (a little) by Paul Irish | |
// takes a GET-serialized string, e.g. first=5&second=3&a=b and sets input tags (e.g. input name="first") to their values (e.g. 5) | |
(function($) { | |
$.fn.unserializeForm = function(values) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* http://meyerweb.com/eric/tools/css/reset/ | |
v2.0 | 20110126 | |
License: none (public domain) */ | |
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
a, abbr, acronym, address, big, cite, code, | |
del, dfn, em, img, ins, kbd, q, s, samp, | |
small, strike, strong, sub, sup, tt, var, | |
b, u, i, center, |
NewerOlder