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 re | |
| import urllib2 | |
| import urllib | |
| import sys | |
| import time | |
| #get html of page | |
| def getHtml(url): | |
| page = urllib2.urlopen(url) | |
| html = page.read() |
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
| ''' | |
| This is a simple code for generate pdf with reportlab. | |
| More information:http://www.reportlab.com/software/opensource/rl-toolkit/faq/ | |
| ''' | |
| from reportlab.pdfgen import canvas | |
| from reportlab.lib.units import cm | |
| my_pdf = canvas.Canvas("hello.pdf") | |
| my_pdf.drawString(9*cm, 22*cm, "Hello World!") | |
| my_pdf.showPage() | |
| my_pdf.save() |
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
| from reportlab.pdfgen import canvas | |
| from reportlab.lib.pagesizes import A4 | |
| from reportlab.lib.units import mm | |
| #I"ll be generating code39 barcodes, others are available | |
| from reportlab.graphics.barcode import code39 | |
| # generate a canvas (A4 in this case, size doesn"t really matter) | |
| c=canvas.Canvas("barcode_example.pdf",pagesize=A4) | |
| # create a barcode object | |
| # (is not displayed yet) |
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
| #!/usr/bin/env python | |
| # -*- coding:utf-8 -*- | |
| #author:rikugun | |
| import sys | |
| import urllib | |
| import os | |
| from shutil import copyfile | |
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
| buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}") | |
| buildNumber=$(($buildNumber + 1)) | |
| /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}" |
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
| NSString *myString = @"1233 12313"; | |
| [myString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] |
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
| //Begin the path | |
| UIBezierPath *path = [[UIBezierPath alloc] init]; | |
| //Move around, add lines or arcs to the path | |
| [path moveToPoint:CGPointMake(75, 10)]; | |
| [path addLineToPoint:CGPointMake(160, 150)]; | |
| [path addLineToPoint:CGPointMake(10, 150]); | |
| //Close the path | |
| [path closePath]; |
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)setPannableView:(UIView *)pannableView // maybe this is a setter in a Controller | |
| { | |
| _pannableView = pannableView; | |
| UIPanGestureRecognizer *pangr = | |
| [[UIPanGestureRecognizer alloc] initWithTarget:pannableView action:@selector(pan:)]; | |
| [pannableView addGestureRecognizer:pangr]; | |
| } | |
| //implement a gesture |
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
| // | |
| // RNSwizzle.m | |
| // MethodSwizzle | |
| #import "RNSwizzle.h" | |
| #import <objc/runtime.h> | |
| @implementation NSObject (RNSwizzle) | |
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
| buildNumber=$(date "+%y%m%d") | |
| /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}" |
OlderNewer