Skip to content

Instantly share code, notes, and snippets.

View destroytoday's full-sized avatar

Jonnie Hallman destroytoday

View GitHub Profile
protected function commitProperties():void
{
if (dirtyDataFlag && data)
{
// do something
if (data.name.search(/[^a-z ]/i > -1 && email)
{
// do something with data
}
protected function commitProperties():void
{
if (dirtyDataFlag && data)
{
// do something
if (data.name.search(/[^a-z ]/i == -1) return;
if (data.email)
// do something with data
protected function commitProperties():void
{
dataChangedCondition: if (dirtyDataFlag && data)
{
// do something
if (data.name.search(/[^a-z ]/i == -1) break dataChangedCondition;
if (data.email)
// do something with data
protected function commitProperties():void
{
if (dirtyDataFlag && data)
{
// do something
if (data.name.search(/[^a-z ]/i > -1)
{
if (data.email)
// do something with data
// the old, lame way
protected var _property:Property;
public function get property():Property
{
if (!_property)
{
_property = new Property();
}
@destroytoday
destroytoday / gist:707232
Created November 19, 2010 21:36
Returns unique timestamps rounded down to the date (SQLite)
SELECT DISTINCT (round(timestamp / 86400000.0 - 0.5) * 86400000.0) as time FROM timeline ORDER BY timestamp ASC
--in AIR, set itemClass to Date
--the returned dates are offset with the computer's timezone, so you need to reverse it: date.time += date.timezoneOffset * 60000;
package com.destroytoday.example
{
public class AccountController
{
[Inject]
public var signalBus:SignalBus;
[Inject]
public var twitterService:TwitterService;
@destroytoday
destroytoday / numLines.rb
Created November 25, 2010 10:24
Prints the number of files and lines of code inside the given path with the given extension
require 'find'
if ARGV.length != 2
raise ArgumentError.new('Two arguments are required: path, extension')
end
path = ARGV[0]
extension = ARGV[1]
numFiles = 0
package com.destroytoday.example
{
public class GetFollowerIDListCommand extends AsyncSignalCommand
{
[Inject]
public var twitterService:ITwitterService;
[Inject]
public var followerModel:FollowerModel;
package com.destroytoday.example
{
public class CaptureFollowerSnapshotCommand extends CompositeSignalCommand
{
[Inject]
public var user:UserVO;
public function CaptureFollowerSnapshotCommand()
{
}