Skip to content

Instantly share code, notes, and snippets.

View mwbrooks's full-sized avatar
🏠
Working from home

Michael Brooks mwbrooks

🏠
Working from home
View GitHub Profile
@mwbrooks
mwbrooks / app.py
Created October 5, 2020 22:52
Button click example using Bolt for Python
@app.action("button_click")
def action_button_click(body, ack, say):
# Acknowledge the action
ack()
say(f"<@{body['user']['id']}> clicked the button")
@mwbrooks
mwbrooks / style.css
Created February 23, 2011 18:50
Remove Tap Highlight from Mobile Webkit
* {
-webkit-touch-callout:none; /* prevent callout to copy image, etc when tap to hold */
-webkit-text-size-adjust:none; /* prevent webkit from resizing text to fit */
-webkit-tap-highlight-color:rgba(0,0,0,0); /* prevent tap highlight color / shadow */
-webkit-user-select:none; /* prevent copy paste, to allow, change 'none' to 'text' */
}
@mwbrooks
mwbrooks / projectAppDelegate.m
Created February 15, 2011 18:43
ON PhoneGap-iOS, open external links in the external browser (Safari.app)
/**
* Note: the following function should already exist in your application delegate file.
* Replace it with the following implementation.
*
* Thanks to @purplecabbage for implementation.
* Thanks to Ruddiger for the iFrame patch.
*/
// ...
@mwbrooks
mwbrooks / notification.confirm.md
Created October 22, 2010 16:48
Markdown code block within list item

iPhone Quirks

  • iPhone does not block while the confirm dialog is displayed.
  • Returns a delegate object from navigator.notification.confirm()
  • Calls delegate.onAlertDismissed(index, label) when confirm is dismissed
    • index is the 0 based index value of the button pressed
    • label is the text label of the button pressed

function showConfirm() {

@mwbrooks
mwbrooks / style.css
Created February 22, 2011 19:34
Remove input field shadow from iOS-Webkit
input[type="text"] {
-webkit-appearance:none; /* Remove default shadow */
border:1px solid black; /* Possibly apply a custom border */
}
@mwbrooks
mwbrooks / read-config.js
Created January 16, 2014 22:22
Read config.json with the Web File API
function readFile(filepath, callback) {
window.requestFileSystem(
LocalFileSystem.PERSISTENT,
0,
function(fileSystem) {
fileSystem.root.getFile(
filepath,
null,
function gotFileEntry(fileEntry) {
fileEntry.file(
/*!
* Module dependencies.
*/
var connect = require('connect'),
http = require('http'),
app = connect();
/**
* Middleware #1
my-app:mwbrooks $ ./cordova/build qnx
Buildfile: /Users/mwbrooks/Dropbox/Development/lib/cordova-cli/lib/cordova-blackberry/my-app/build.xml
qnx:
build:
generate-cod-name:
[echo] Generated name: __NAME__.bar
$ npm test
> cordova@0.0.8 test /Users/mwbrooks/Dropbox/Development/lib/cordova-client
> node test_bootstrap.js && ./node_modules/jasmine-node/bin/jasmine-node --color spec
.shell.js: internal error
Error: ENOENT, no such file or directory '/Users/mwbrooks/Dropbox/Development/lib/cordova-client/temp/platforms/android/assets/www'
at Object.fs.mkdirSync (fs.js:483:18)
at /Users/mwbrooks/Dropbox/Development/lib/cordova-client/node_modules/shelljs/shell.js:297:14
at Array.forEach (native)
@mwbrooks
mwbrooks / apache-cordova-1.4-release-meeting.md
Created January 20, 2012 19:00
Meeting Notes for the Apache Cordova 1.4 Release

PhoneGap 1.4 Release Meeting

Attendance

Wiki

  • Style guide
  • Roadmap
  • Brian would like everyone to review it