Skip to content

Instantly share code, notes, and snippets.

View jayproulx's full-sized avatar
🎯
Focusing

Jay Proulx jayproulx

🎯
Focusing
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
<!-- Design/style -->
<filter root="/etc/designs/myproject"/>
</workspaceFilter>

Keybase proof

I hereby claim:

  • I am jayproulx on github.
  • I am jayproulx (https://keybase.io/jayproulx) on keybase.
  • I have a public key whose fingerprint is B461 166B 5873 7378 844D 366C 461B 3427 E86B 0EC6

To claim this, I am signing this object:

@jayproulx
jayproulx / create_hooks.sh
Last active August 29, 2015 14:11
Create all of the hook directories and add a script to identify the hook running when it executes
#!/bin/bash
# run this as a script in your-phonegap-project/hooks
hooks=(after_build after_compile after_docs after_emulate after_platform_add after_platform_rm after_platform_ls after_plugin_add after_plugin_ls after_plugin_rm after_plugin_search after_plugin_install after_prepare after_run after_serve before_build before_compile before_docs before_emulate before_platform_add before_platform_rm before_platform_ls before_plugin_add before_plugin_ls before_plugin_rm before_plugin_search before_plugin_install before_plugin_uninstall before_prepare before_run before_serve pre_package);
for hook in ${hooks[@]}
do
mkdir "${hook}"
script="1_identify_hook.js"
@jayproulx
jayproulx / simpleorderstatus.js
Last active August 29, 2015 14:15
Sinelabs Simple Order Status
re = /^([\w]+)([\+\-\.\w]*)@([\-\.\w]+)(\.[\w]{2,17}){1,2}$/;
@jayproulx
jayproulx / aircanada_11112013.js
Last active August 29, 2015 14:17
Air Canada Email Validation
// http://help-aircanada.com/aircanada-help/js/aircanada_11112013.js
//This function is used to validate email address : Returns true if email is valid
function isEmailValid(emailToValidate){
//var regex1=/^([_A-Za-z0-9-/&]+(\.[_A-Za-z0-9-/&]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.(([A-Za-z]{2,3})|(aero|coop|info|museum)))?$/
//return regex1.test(emailToValidate);
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,17})+$/.test(emailToValidate))
{
return (true);
function lineTowards(g:Graphics, x:int, y:int, length:int):void
{
var c:Number = Math.sqrt(Math.sqr(x) + Math.sqr(y));
var ratio:Number = length / c;
g.lineTo(x*ratio, y*ratio);
}
// Flash/Chrome/FireBug logging through console:
function logMe(message:String):void {
ExternalInterface.call("console.log", message);
}
@jayproulx
jayproulx / MXMLSingleton.as
Created December 21, 2010 15:53
Creating MXML Singletons
/**
* User: jproulx
* Date: 12/21/10
* Time: 10:15 AM
*/
package
{
import flash.utils.Dictionary;
import flash.utils.getDefinitionByName;
import flash.utils.getQualifiedClassName;
@jayproulx
jayproulx / SignalAsyncToken.as
Created January 31, 2011 19:17
Signals don't like the ... rest operator.
package com.pollensoft.pbt.twitter
{
import mx.core.mx_internal;
import mx.messaging.messages.IMessage;
import mx.rpc.AsyncToken;
use namespace mx_internal;
import org.osflash.signals.Signal;
import mx.rpc.events.ResultEvent;
@jayproulx
jayproulx / hideaddrbar.js
Created February 1, 2012 15:57 — forked from scottjehl/hideaddrbar.js
Normalized hide address bar for iOS & Android
/*
* Normalized hide address bar for iOS & Android
* (c) Scott Jehl, scottjehl.com
* MIT License
*/
(function( win ){
var doc = win.document;
// If there's a hash, or addEventListener is undefined, stop here
if( !location.hash && win.addEventListener ){