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
- (UIImage *)blendOverlay:(UIImage *)topImage withBaseImage:(UIImage *)baseImage toSize:(CGFloat)imageSize | |
{ | |
UIGraphicsBeginImageContext(CGSizeMake(imageSize, imageSize)); | |
[baseImage drawInRect:CGRectMake(0.0, 0.0, imageSize, imageSize)]; | |
[topImage drawInRect:CGRectMake(0.0, 0.0, imageSize, imageSize) blendMode:kCGBlendModeNormal alpha:0.5]; | |
UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); | |
return 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
-(UIImage *) negativeImage | |
{ | |
UIGraphicsBeginImageContext(self.size); | |
CGContextSetBlendMode(UIGraphicsGetCurrentContext(), kCGBlendModeCopy); | |
[self drawInRect:CGRectMake(0, 0, self.size.width, self.size.height)]; | |
CGContextSetBlendMode(UIGraphicsGetCurrentContext(), kCGBlendModeDifference); | |
CGContextSetFillColorWithColor(UIGraphicsGetCurrentContext(),[UIColor whiteColor].CGColor); | |
CGContextFillRect(UIGraphicsGetCurrentContext(), CGRectMake(0, 0, self.size.width, self.size.height)); | |
UIImage *negativeImage = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); |
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
package com.chroman.test; | |
import android.app.DatePickerDialog; | |
import android.content.Context; | |
import android.widget.DatePicker; | |
/** | |
* Created by chroman on 09/10/13. | |
*/ | |
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
grep -Ri 'oldprojectame' * | cut -f1 -d':' | sort | uniq |
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
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" | |
android:orientation="vertical" | |
tools:context=".MainActivity"> | |
<RelativeLayout | |
android:layout_width="fill_parent" | |
android:layout_height="wrap_content"> |
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/sh | |
# | |
# A shell script used to setup rules for iptables. Rules gleened from | |
# various websites. | |
# | |
# References: | |
# http://www.newartisans.com/blog_files/tricks.with.iptables.php | |
# Wipe the tables clean | |
iptables -F |
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/sh | |
# | |
# nginx Startup script for nginx | |
# | |
# chkconfig: - 85 15 | |
# processname: nginx | |
# config: /etc/nginx/nginx.conf | |
# config: /etc/sysconfig/nginx | |
# pidfile: /var/run/nginx.pid | |
# description: nginx is an HTTP and reverse proxy server |
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
sh -c 'cat /usr/share/dict/words | sed -n $(echo $((`cat /dev/urandom | od -N3 -An -i` % `cat /usr/share/dict/words | wc -l`)))p' |
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
jQuery.ajax({ | |
type: 'POST', | |
url: 'validarCodigoInvitacion', | |
data: {inputCodigo : '41F8**** tu codigo'}, | |
dataType: 'json', | |
success: function(response) { console.log(response) ;}, | |
error: function(req, err){ console.log(err); } | |
}); |
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
NSString *address = @"http://gdata.youtube.com/feeds/api/playlists/PLH6Z1vsFvaeTMmRL8GfC3i_rAwLKOOtNF?v=2"; | |
NSURL *url = [[NSURL alloc] initWithString:address]; | |
NSError *error; | |
NSString *XML = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:&error]; | |
NSData *data = [XML dataUsingEncoding:NSUTF8StringEncoding]; | |
NSXMLParser *parser = [[NSXMLParser alloc] initWithData:data]; |