For the scenario, imagine posts has a foreign key user_id referencing users.id
public function up()
{
Schema::create('posts', function(Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->text('body');For the scenario, imagine posts has a foreign key user_id referencing users.id
public function up()
{
Schema::create('posts', function(Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->text('body');| var SerialPort = require('serialport').SerialPort; | |
| var xbee_api = require('xbee-api'); | |
| var C = xbee_api.constants; | |
| var Q = require('q'); | |
| // following settings work for me on my Raspberry pi, your config may differ! | |
| var xbeeAPI = new xbee_api.XBeeAPI({ | |
| api_mode: 1 | |
| }); | |
| var serialport = new SerialPort("/dev/ttyAMA0", { |
| <?php | |
| $regex = "/\b(p\.?\s?o\.?\b|post office|\d{2,5})\s*(?:\S\s*){8,50}(AK|Alaska|AL|Alabama|AR|Arkansas|AZ|Arizona|CA|California|CO|Colorado|CT|Connecticut|DC|Washington\sDC|Washington\D\.C\.|DE|Delaware|FL|Florida|GA|Georgia|GU|Guam|HI|Hawaii|IA|Iowa|ID|Idaho|IL|Illinois|IN|Indiana|KS|Kansas|KY|Kentucky|LA|Louisiana|MA|Massachusetts|MD|Maryland|ME|Maine|MI|Michigan|MN|Minnesota|MO|Missouri|MS|Mississippi|MT|Montana|NC|North\sCarolina|ND|North\sDakota|NE|New\sEngland|NH|New\sHampshire|NJ|New\sJersey|NM|New\sMexico|NV|Nevada|NY|New\sYork|OH|Ohio|OK|Oklahoma|OR|Oregon|PA|Pennsylvania|RI|Rhode\sIsland|SC|South\sCarolina|SD|South\sDakota|TN|Tennessee|TX|Texas|UT|Utah|VA|Virginia|VI|Virgin\sIslands|VT|Vermont|WA|Washington|WI|Wisconsin|WV|West\sVirginia|WY|Wyoming)(\s+|\ \;|\<(\S|\s){1,10}\>){1,5}\d{5}/i"; | |
| ?> |
This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.
ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
Other options for PDFSETTINGS:
| package com.itextpdf; | |
| import com.itextpdf.text.Rectangle; | |
| import com.itextpdf.text.pdf.PdfArray; | |
| import com.itextpdf.text.pdf.PdfDictionary; | |
| import com.itextpdf.text.pdf.PdfName; | |
| import com.itextpdf.text.pdf.PdfReader; | |
| import com.itextpdf.text.pdf.PdfString; | |
| import com.itextpdf.text.pdf.parser.FilteredTextRenderListener; | |
| import com.itextpdf.text.pdf.parser.LocationTextExtractionStrategy; |
| # Capistrano Laravel 4 Deployment Tasks | |
| # Watts Martin (layotl at gmail com) | |
| # https://gist.github.com/chipotle/5506641 | |
| # updated 14-Aug-2013 | |
| # Assumptions: | |
| # | |
| # - You are using a .gitignore similar to Laravel's default, so your | |
| # vendor directory and composer(.phar) are *not* under version control | |
| # - Composer is installed as an executable at /usr/local/bin/composer |
| pdftk original.pdf output uncompressed.pdf uncompress | |
| LANG=C sed -n '/^\/Annots/!p' uncompressed.pdf > stripped.pdf | |
| pdftk stripped.pdf output final.pdf compress |
| <?xml version="1.0" ?><manifest android:versionCode="1" android:versionName="1" package="com.appcelerator.holotheme" xmlns:android="http://schemas.android.com/apk/res/android"> | |
| <uses-sdk android:minSdkVersion="8"/> | |
| <uses-sdk android:targetSdkVersion="14"/> | |
| <!-- TI_MANIFEST --> | |
| <application android:debuggable="false" android:icon="@drawable/appicon" android:label="HoloTheme" android:name="HolothemeApplication" android:theme="@android:style/Theme.Holo.Light"> | |
| <!-- TI_APPLICATION --> |
| @Entity | |
| public class TreeCategory extends IdentifiableEntity { | |
| .... | |
| @ManyToOne(optional = true) | |
| @JoinColumn(name = "parent_id", referencedColumnName = "id") | |
| public TreeCategory getParent() { | |
| return parent; | |
| } |
| Be sure to leave out trailing slashes | |
| UPDATE wp_options SET option_value = replace(option_value, 'http://oldURL', 'http://yourUrl'); | |
| UPDATE wp_posts SET guid = replace(guid, 'http://oldURL', 'http://yourUrl'); | |
| UPDATE wp_posts SET post_content = replace(post_content, 'http://oldURL', 'http://yourUrl'); | |
| UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://oldURL', 'http://yourUrl'); |