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
| /** | |
| * Compares two software version numbers (e.g. "1.7.1" or "1.2b"). | |
| * | |
| * This function was born in http://stackoverflow.com/a/6832721. | |
| * | |
| * @param {string} v1 The first version to be compared. | |
| * @param {string} v2 The second version to be compared. | |
| * @param {object} [options] Optional flags that affect comparison behavior: | |
| * <ul> | |
| * <li> |
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
| /* Sample JavaScript file added with ScriptTag resource. | |
| This sample file is meant to teach best practices. | |
| Your app will load jQuery if it's not defined. | |
| Your app will load jQuery if jQuery is defined but is too old, e.g. < 1.7. | |
| Your app does not change the definition of $ or jQuery outside the app. | |
| Example: if a Shopify theme uses jQuery 1.4.2, both of these statements run in the console will still return '1.4.2' | |
| once the app is installed, even if the app uses jQuery 1.9.1: | |
| jQuery.fn.jquery => "1.4.2" | |
| $.fn.jquery -> "1.4.2" | |
| */ |
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 pyPdf import PdfFileWriter, PdfFileReader | |
| import StringIO | |
| from reportlab.pdfgen import canvas | |
| from reportlab.lib.pagesizes import letter | |
| packet = StringIO.StringIO() | |
| # create a new PDF with Reportlab | |
| can = canvas.Canvas(packet, pagesize=letter) | |
| can.drawString(100,100, "Hello world") | |
| can.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
| <?php | |
| function folks_db_report() { | |
| $header = array( | |
| 'id' => array('data' => t('Id'), 'field' => 'u.id'), | |
| 'first_name' => array('data' => t('First Name'), 'field' => 'u.first_name'), | |
| 'last_name' => array('data' => t('Last Name'), 'field' => 'u.last_name'), | |
| 'color' => array('data' => t('Favorite Color'), 'field' => 'u.color'), | |
| ); | |
NewerOlder