Skip to content

Instantly share code, notes, and snippets.

@jacqui
jacqui / field.rb
Created June 3, 2010 13:58
Using embedded documents to store field data
class Field
include MongoMapper::EmbeddedDocument
key :name, String
key :label, String, :required => true
key :helper_text, String
key :required, Boolean, :default => false
key :widget, String, :required => true
key :options, Array # => [[value, label], [value, label], [value, label]]
key :selected, String
@agaoglu
agaoglu / USAGE.md
Created October 7, 2010 15:29
Simple CRUD function for couchapps

CRUD requires jquery.deepjson.js to work so it should be included

<script type="text/javascript" src="js/jquery.deepjson.js"></script>

Then you can assign whatever's in crud.json to a variable or you can put crud.json into your evently directory and let couchapp push it to your application.

Simplest way to use it is

@drewjoh
drewjoh / example.php
Last active January 11, 2021 18:06 — forked from mloberg/example.php
A Simple Postmark PHP Class with Attachments
<?php
require("postmark.php");
$postmark = new Postmark("your-api-key","from-email","optional-reply-to-address");
$result = $postmark->to("[email protected]")
->subject("Email Subject")
->plain_message("This is a plain text message.")
->attachment('File.pdf', base64_encode(file_get_contents('sample.pdf')), 'application/pdf')
@leecrossley
leecrossley / shake.js
Last active December 28, 2021 10:56
Shake gesture detection in PhoneGap / Cordova
/*
THIS GIST IS OUT OF DATE AND NOT MONITORED
PLEASE SEE https://github.com/leecrossley/cordova-plugin-shake-detection
*/
var shake = (function () {
var shake = {},
watchId = null,
options = { frequency: 300 },
previousAcceleration = { x: null, y: null, z: null },
@nick-merrill
nick-merrill / co.nickmerrill.cursors.app-demo-disc.cape
Created September 4, 2014 21:56
Mousecape cursor for demoing apps
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Author</key>
<string>Nick Merrill</string>
<key>CapeName</key>
<string>App Demo Disc</string>
<key>CapeVersion</key>
<real>1</real>