Skip to content

Instantly share code, notes, and snippets.

Jim Pravetz jpravetz

Block or report user

Report or block jpravetz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jpravetz
jpravetz / resource-list.js
Created May 9, 2018
Aurelia CLI Task to Generate Webpack-compatible index.js files under the src/resources folder
View resource-list.js
import gulp from 'gulp';
import project from '../aurelia.json';
import fs from 'fs';
import Path from 'path';
import util from 'util';
/**
* Task generates webpack compatible index.js files under the src/resources folder,
* recursively descending and including every file that is found.
* To exclude files in a particular folder, add their names to a .resourceignore file in that
@jpravetz
jpravetz / BusyPromise
Created Jan 8, 2018
Promise wrapper, can be used in Node or in browser with transpiling
View BusyPromise
export class BusyPromise {
/**
* Promise wrapper that calls pre and post methods. Can be used to auto increment and decrement a
* counter, for example, or to indicate when busy and unbusy.
* @param opts {Object}
* @param [opts.pre] {Function} Function to execute before calling function
* @param [opts.onResolve] {Function} Function to execute after function resolves
* @param [opts.onReject] {Function} Function to execute if function rejects
* @param fn {function} Same as function in new Promise(fn)
@jpravetz
jpravetz / product_generator.rb
Created Dec 2, 2011
Jekyll generator to read json data file and generate product and ingredient pages
View product_generator.rb
#------------------------------------------------------------------------
# encoding: utf-8
# @(#)product_generator.rb 1.00 29-Nov-2011 16:38
#
# Copyright (c) 2011 Jim Pravetz. All Rights Reserved.
# Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
#
# Description: A generator that creates product, products and
# ingredients pages for jekyll sites. Uses a JSON data
# file as the database file from which to read and
@jpravetz
jpravetz / TestTransition.mxml
Created Aug 19, 2011
Flex 4.x Example showing dialog sliding down and compressing VDiv below
View TestTransition.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:yahoo="http://www.yahoo.com/astra/2006/mxml"
xmlns:local="*">
<fx:Declarations>
<s:Parallel id="showRect"
duration="400"
@jpravetz
jpravetz / TextLink.mxml
Created Jul 22, 2011
Example that show how automated clicking of a link in an HTML control does not work after running a timer
View TextLink.mxml
@jpravetz
jpravetz / JsonMapper.as
Created Nov 10, 2010
Converts a tree of JSON objects into a tree of typed ActionScript objects
View JsonMapper.as
/*************************************************************************
* Copyright 2010 Cayo Systems, Inc.
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
* notice and this notice are preserved.
* Author: Jim Pravetz
* Date: 2010/11/11
* Language: ActionScript 3.0
**************************************************************************/
You can’t perform that action at this time.