Skip to content

Instantly share code, notes, and snippets.

Database Design
Front End Admin UI
List Surveys Interface
Survey template interface
Survey Print
Add/Edit Survey
Deficiency Routing
Question Settings
Add Question Search
@dmertl
dmertl / gist:5626172
Created May 22, 2013 08:50
Balloon calculation
Weight difference: 3g
Aprox balloon weight: 1g
Total lift = 3g + 1g = 4g
Weight of air at STP: 1.20g/L
Weight of He at STP: 0.18g/L
He lift at STP = 1.2g/L - 0.18g/L = 1.02g/L
Volume of He = 4g / 1.02g/L = 4L
<html>
<head>
<style type="text/css">
#test-image {
border: solid 3px #F00;
border-radius: 10px;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
#test-wrap {
<html>
<head>
<style type="text/css">
#test-image {
border-radius: 10px;
box-shadow: 0 0 0 3px red;
}
#test-wrap {
display: inline-block;
border: solid 3px #F00;
Make database changes
The first step in creating a migration is to make any schema changes to the database. If the changes are to the data only you can skip this step.
Create migration file
Next we create a migration file with the differences between the current app/Config/Schema/schema.php file and the database. To do this execute the Console/cake Migrations.migration generate command with the following options:
Do you want compare the schema.php file to the database? - y
Do you want to preview the file before generation? - n
Please enter the descriptive name of the migration to generate: - Name of migration
Do you want update the schema.php file? - y
@dmertl
dmertl / gist:a9de8f8cb3129e1a2c5a
Created June 9, 2014 22:51
Concise Python Expressions
# Because searching for these is always a pain
# Conditional Assignment
setting = 'default' if param is None else param
@dmertl
dmertl / Make AWS EC2 Attached EBS Volume Available on CentOS.md
Last active January 2, 2018 20:22
Make AWS EC2 Attached EBS Volume Available on CentOS

Assuming device /dev/xvdd being mounted to /data.

sudo mkfs -t ext4 /dev/xvdd
sudo mkdir /data
sudo mount /dev/xvdd /data

Add line to /etc/fstab to mount every boot:

sudo vi /etc/fstab

/dev/xvdd /data ext4 defaults,nofail 0 2

@dmertl
dmertl / mac_os_x_cheatsheet.md
Last active November 28, 2024 05:55
Mac OS X Cheatsheet

Stop Slack/Teams from Copy Pasting with Formatting

The Paste command will paste with formatting, Paste and Match Style will not. Swap the keyboard shortcuts in System Settings - Keyboard Shortcuts - Keyboard Shortcuts... - App Shortcuts. Then add shortcuts for the specific app you want to change.

What is Preventing Sleep?

pmset -g

# sleep 1 (sleep prevented by iTunes, coreaudiod)