Skip to content

Instantly share code, notes, and snippets.

View sanderson's full-sized avatar

Scott Anderson sanderson

View GitHub Profile
@sanderson
sanderson / PHP Version in the Boxfile
Created May 10, 2013 22:30
Specifying your PHP version in your Boxfile
web1:
php_version: 5.4.14
@sanderson
sanderson / Composer on Pagoda Box
Created May 14, 2013 21:29
Using Composer on Pagoda Box
web1:
after_build:
- "if [ ! -f composer.phar ]; then curl -s http://getcomposer.org/installer | php; fi; php composer.phar install"
php_extensions:
- zip
- curl
@sanderson
sanderson / Logs in the Boxfile
Created May 21, 2013 17:43
Enabling/Disabling Logs in the Boxfile
web1:
apache_access_log: false
apache_error_log: true
php_error_log: true
php_fpm_log: true
web1:
document_root: public
php_version: 5.3.10
php_extensions:
- mbstring
- mcrypt
- pdo_mysql
- mysql
- apc
- memcached
#!/bin/bash
# Exits script on error
set -e
# Export a backup from db1 into writable storage
mysqldump -h $DB1_HOST -P $DB1_PORT $DB1_NAME -u $DB1_USER -p$DB1_PASS > path/to/writable_dir/data_migration.sql
# Import the backup into db2
mysql -h $DB2_HOST -P $DB2_PORT -u $DB2_USER -p$DB2_PASS $DB2_NAME < path/to/writable_dir/data_migration.sql
@sanderson
sanderson / media-queries.scss
Created November 12, 2015 23:38
Simple SCSS Media Query Template
// Upper and Lower Ends
$sm-upper: "(max-width: 40em)"; /* 640px */
$md-lower: "(min-width: 40.063em)"; /* 641px */
$md-upper: "(max-width: 54em)"; /* 864px */
$lg-lower: "(min-width: 54.063em)"; /* 865px */
$lg-upper: "(max-width: 90em)"; /* 1440px */
// Specifications
$screen: only screen !default;
{"assets":[{"id":"image_0","w":111,"h":111,"p":"images/img_0.png"},{"id":"image_1","w":110,"h":110,"p":"images/img_1.png"},{"id":"comp_9","layers":[{"ind":0,"ty":4,"ks":{"o":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":"0p833_0p833_0p167_0p167","t":121,"s":[80],"e":[0]},{"t":124.000005050624}],"r":0,"p":[512.003,340.743,0],"a":[323.998,39.743,0],"s":[100,100,100]},"shapes":[{"ty":"sh","closed":true,"ks":[{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0.167},"n":"0p667_1_0p167_0p167","t":0,"s":[{"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]
8950 4e47 0d0a 1a0a 0000 000d 4948 4452
0000 006f 0000 006f 0806 0000 00e2 c59e
6000 000b 3d49 4441 5478 9ced 9dcf 6be3
661a c7df 6c8b 9121 2656 0c03 3234 7234
8c87 4aa6 3116 4b13 6c6a 977a 6006 12aa
43cd 6e0f d3f1 cca1 bb7b f37f 50f7 b47b
746f 4b0b 3b9e 9943 0f2e acc3 4cd9 8171
97b8 d80c 3dd8 78c0 d696 049c 084a 5418
1cdb c410 6132 b007 e59d 98d8 b225 5992
e5e4 fd1c 9d58 92df af9e f77d de1f cff3
@sanderson
sanderson / nanobox-v1-to-v2.md
Last active February 8, 2017 00:15
Moving from Nanobox v1 to v2

Moving from Nanobox v1 to v2

Nanobox v2 is here and provides some significant advantages when compared to v1 (most notable is support for native Docker containers). There have been changes to the Nanobox core that require a fresh install.

Uninstall Nanobox v1

If you have local data you want to preserve, you should export it before unistalling

  1. Use the nanobox implode command to destroy all your v1 apps.
  2. Remove/Uninstall the Nanobox binaries - nanobox and nanobox-update. (Windows users, do this through the system uninstaller)
  3. If you've been using netfs for filesystem mounting, remove the Nanobox entries in your /ect/exports files.
@sanderson
sanderson / boxfile.yml
Created April 7, 2017 15:50
Changes to CraftCMS for Nanobox
run.config:
engine: php
engine.config:
runtime: php-7.0
document_root: public
webserver: apache
extensions:
- ctype
- pdo
- pdo_mysql