This file contains 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 | |
# Edit these to point to the proper source | |
# and destination locations | |
SOURCE_LOCATION="<SOURCE LOCATION HERE>" | |
DEST="<DESTINATION LOCATION HERE>" | |
echo -e "\033[93m------------------------------------" | |
echo -e "\033[93mCopy files from source location v1.0" | |
echo -e "\033[93m------------------------------------" |
This file contains 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 | |
/* JUST ADD THIS CODE TO YOUR THEMES functions.php */ | |
/* Customize the last half, the output half to suit your projects needs */ | |
add_filter('post_gallery', 'my_post_gallery', 10, 2); | |
function my_post_gallery($output, $attr) { | |
global $post; | |
if (isset($attr['orderby'])) { | |
$attr['orderby'] = sanitize_sql_orderby($attr['orderby']); |
This file contains 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
function html2txt($document){ | |
$search = array('@<script[^>]*?>.*?</script>@si', // Strip out javascript | |
'@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags | |
'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly | |
'@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments including CDATA | |
); | |
$text = preg_replace($search, '', $document); | |
return $text; | |
} |
This file contains 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
/*Ugh. If I say the width is 200px, gosh darn it, it’s gonna be a 200px wide box even if I have 20px of padding. | |
So as you know, this is NOT how the box model has worked for the past ten years. Anyway, I have a recommendation | |
for your CSS going forward: (Paul Irish via: http://www.paulirish.com/2012/box-sizing-border-box-ftw/) */ | |
/* apply a natural box layout model to all elements, but allowing components to change */ | |
html { | |
box-sizing: border-box; | |
} | |
*, *:before, *:after { | |
box-sizing: inherit; |
This file contains 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
// Create an NSString that can that be copied into an NSArray | |
// of all the font names available to your Objective-C App | |
NSMutableString *str = [[NSMutableString alloc] initWithString:@""]; | |
for (NSString *family in [UIFont familyNames]) { | |
[str appendString:@"//"]; | |
[str appendString:family]; | |
[str appendString:@"\n"]; | |
This file contains 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
// This function will create perfect-circle cutout of any image you supply. | |
// So if you have a solid black image, the resulting PNG will be a "cutout-out" (transparent) | |
// circle with a border of solid black. It will return NSData (for use with Parse's PFFile), | |
// but can be easily modified to return the resulting UIImage (*img) | |
// | |
// @param {UIImage} The image you want to "cutout" | |
// @param {CGSize} The size (width and height) you want the resulting image to be | |
// return {NSData} the PNGrepresentation of the resulting UIImage | |
-(NSData *)createCircleCutOutofImage:(UIImage *)image withSize:(CGSize)size { | |
This file contains 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
// @param {UIImage} The rectangle image you want to convert to a round image | |
// @param {CGSize} The size (width and height) of the resulting round image | |
// @return {NSData} the PNGRepresentation of the resulting round image | |
-(NSData *)rectangleImageToTransparentRoundImageFromImage:(UIImage *)image withSize:(CGSize)size { | |
UIGraphicsBeginImageContextWithOptions(size, NO, 0.0); | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
UIImageView *_imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, size.width, size.height)]; | |
_imgView.image = image; |
This file contains 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)stylePFLoadingViewTheHardWay | |
{ | |
UIColor *labelTextColor = [UIColor whiteColor]; | |
UIColor *labelShadowColor = [UIColor darkGrayColor]; | |
UIActivityIndicatorViewStyle activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhite; | |
// go through all of the subviews until you find a PFLoadingView subclass | |
for (UIView *subview in self.view.subviews) | |
{ | |
if ([subview class] == NSClassFromString(@"PFLoadingView")) |
This file contains 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
var gulp = require('gulp'); | |
var minifyCSS = require('gulp-minify-css'); | |
var concat = require('gulp-concat'); | |
var browserSync = require('browser-sync').create(); | |
var paths = { | |
css: ['./css/*.css'], | |
scripts: ['./js/*.js'], | |
html: ['./*.html'] | |
}; |
OlderNewer