Skip to content

Instantly share code, notes, and snippets.

View brianleroux's full-sized avatar
💚
You are now aware that you are breathing

Brian LeRoux brianleroux

💚
You are now aware that you are breathing
View GitHub Profile
@brianleroux
brianleroux / .arc
Created February 8, 2018 18:59 — forked from mandeluna/.arc
# this is an .arc file!
@app
hellobot
@html
get / # displays Add to Slack
get /install # saves a bot token and redirects back to /
get /signin # saves a user token and redirects back to /
@slack
@brianleroux
brianleroux / hello-cordova.html
Created May 29, 2012 20:42 — forked from purdrew/helloCordova.html
Hello World Cordova
<!DOCTYPE html>
<html>
<head>
<meta http-equiv=Content-Type content=text/html;charset=UTF-8>
<meta name=viewport id=viewport content=width=device-width,height=device-height,initial-scale=1.0,user-scalable=no>
<title>Hello Cordova</title>
</head>
<body>
<h1 id=hello>Initializing...</h1>
@brianleroux
brianleroux / phonegap-photofetcher.js
Created March 23, 2012 20:12 — forked from pamelafox/phonegap-photofetcher.js
PhoneGap Convert Photo File URI to Data URI
function getPhoto() {
navigator.camera.getPicture(onPhotoSuccess, onPhotoFail,
{quality: 70, targetWidth: 500, targetHeight: 500,
sourceType: navigator.camera.SourceType.PHOTOLIBRARY,
destinationType: navigator.camera.DestinationType.FILE_URI,
});
}
function onPhotoSuccess(imageUri) {
var $img = $('<img/>');
@brianleroux
brianleroux / standards.md
Created October 25, 2011 16:20 — forked from paulirish/standards.md
jQuery Standards Team

#Announcing The jQuery Standards Team

Today we're happy to announce the creation of a new jQuery sub-team called the jQuery Standards Team to give web developers to have a voice in the standards process.

##Introduction

We all know that web standards are important. They help ensure the code we write works across different technologies, for people of different abilities and most importantly across all browsers.

That said, how often do we all feel our voices, suggestions and ideas are heard by those groups responsible for defining these standards? The reality is that whilst many of us would like to see change, due to time restrictions and lengthy formal processes we're unable to participate in standards discussions, get involved with writing specifications and contribute to meetings about the future of features. This makes it difficult for web developers to have a voice.

// curl -k https://localhost:8000/
var https = require('https');
var fs = require('fs');
var options = {
key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
};
var server = https.createServer(options, function (req, res) {

PhoneGap Training Day

 9:30 -  9:45 ... introductions
 9:45 - 10:30 ... intro to the phonegap project and mobile development (brian)
10:30 - 10:45 ... break
10:45 - 12:30 ... in depth code tutorial 
12:30 -  1:30 ... lunch
 1:30 -  2:30 ... phonegap apis walkthru, gotchas, etc

2:30 - 3:00 ... complimentary tools (xui, lawnchair)

// In the .h file …..
#import
#import “PhoneGapCommand.h”
@interface FlurryAPI : PhoneGapCommand {
}
- (void)doit:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
@end
// in the .m file
(function ($, window, undefined) {
var m = document.createElement('i'),
m_style = m.style,
// TODO support other browsers easings - based on Safari's easing options and ported to Emile easing.
stanardEasing = {
'ease-in-out' : function(pos){if((pos/=0.5)<1){return 0.5*Math.pow(pos,4);}return -0.5*((pos-=2)*Math.pow(pos,3)-2);},
'ease-in' : function(pos){return Math.pow(pos,4);},
'ease-out' : function(pos){return Math.pow(pos,0.25);},
'linear': function (i) {return i;}
system.use("info.webtoolkit.Base64");
var username = "admin";
var password = "password";
var auth = "Basic " + Base64.encode(username + ":"+ password);
checkAuth = function() {
if (!this.request.headers.hasOwnProperty('Authorization') || (this.request.headers.hasOwnProperty('Authorization') && (auth != this.request.headers['Authorization']))) {
this.response.headers['WWW-Authenticate'] = 'Basic realm="SmartAPI"';
this.response.code = 401;
this.response.body = "Not Authorized\n";
Here's an example of how I was able to use the rsp from Smart.app to run on a different
port at the same time. It would be nice if this ability was built into the GUI app, but
for now, I hacked it.
I made a directory for my app here:
/Users/jim/joyent/rsp/local-smartasks
I put the application source in a subdirectory called '127.0.0.1'. So the bootstrap.js is
at /Users/jim/joyent/rsp/local-smartasks/127.0.0.1/js/bootstrap.js