Archive for the Uncategorized Category

Multi-site Wordpress max. file upload gotcha

Posted in Uncategorized on July 30, 2014 by andkrup

If you’re setting up a wordpress installation as a multi-site installation, you will find that Multi-site WordPress begins to care about your user-uploads.

If you’ve set up your php.ini to not flash file size restrictions in the face of your users, you will have to change some settings from their default values.

Notice that the default threshold is set at a value that may restrict some high-res retina png files. Screen Shot 2014-07-30 at 10.17.57 AM

These settings are imposed on top of the post_max_sizeupload_max_filesize settings in your php.ini, so have this in mind when you’re working with multi-site installations.

Check this page for the settings available:

https://codex.wordpress.org/Network_Admin_Settings_Screen#Upload_Settings

Advertisements

Let your Wordpress theme support gettext

Posted in Uncategorized on August 9, 2013 by andkrup

Has anyone tried translating your wordpress theme, using gettext?

I found I had to add a callback to the gettext filter in order to have wordpress recognize my *.mo files:


add_filter('gettext','patched_translate', 10, 3);

function patched_translate($translations, $text, $domain = 'default'){
  $translations = get_translations_for_domain( $domain );
  if($domain == 'default'){
    return $translations->translate($text);
  }
  $translation = $translations->translate( $domain.chr(4).$text );
  if($translation == $domain.chr(4).$text){
    return $text;
  }
  return $translation;
}

Commandline urlencoding/urldecoding alias

Posted in Uncategorized with tags , , , , on April 4, 2013 by andkrup

Here’s a clever bash alias for quick string url- encoding/decoding:

http://ruslanspivak.com/2010/06/02/urlencode-and-urldecode-from-a-command-line/

Mxml

Posted in Uncategorized with tags , , on November 3, 2011 by andkrup

Here’s a little neat trick I didn’t know – actually I haven’t used mxml that much so I don’t really know if this is trivial…

<?xml version="1.0"?>
<fd:MovieClip xmlns:mx="http://ns.adobe.com/mxml/2009"
    xmlns:fd="flash.display.*">
</fd:MovieClip>

It looks like a custom component, but actually it’s just a bread’n’butter MovieClip (or it’s a componentized MovieClip).

It compiles as a swf with the mxml compiler, so flex applications doesn’t have to use <mx:Application/> as root element.

In other words, you don’t have to use the flex component framework in order to use mxml to mark up your application layout.

Obviously, you will then have to manage the layout yourself.

_root Malpractice

Posted in Uncategorized with tags , , , on December 10, 2009 by andkrup

more centipedes

Actually it is probably not malpractice (as in using _root to reference the main timeline not because you want the lowest/outermost timeline, but because of lack of knowledge of other means to reference other timelines), but the _root reference is being used quite a lot in the AS2 mx packages (do a text search of the mx files in your flash config folder: (Userfolder)/Library/Application Support/Adobe/Flash CS4/en/Configuration/Classes/mx).

Please remember this before you misinterpret decompiled sourcecode and accuse someone of _root malpractice.

(_root malpractice is common for people that is not used to create swf files that may or may not be loaded into other swf files, changing the _root reference. Lockroot, notwithstanding, _root should not be used as a common reference to your main timeline. It’s a common misuse and should be handled as any other z-infestation, i.e. quarantined, handled by military types and ultimately nuked by the gov.)

$(UserConfig) variable in Flash CS4

Posted in Uncategorized with tags , , , , on November 17, 2009 by andkrup

I didn’t know, but it seems that you can reference your user-config folder with the $(UserConfig) variable, when setting class paths in Flash CS4.

You can create an mxi file that distributes a swc file and a jsfl command that adds “$(UserConfig)/Libraries” to the library path of the current working document.

The mxi extension source file:

<macromedia-extension name="Electric Library" version="0.1.0" type="flashcomponentswc" requires-restart = "false" >
<author name="Me" />
<products>
<product name="Flash" version="8" primary="true" required="true"/>
</products>
<description>
<![CDATA[My Library]]>
</description>
<ui-access>
<![CDATA[n/a]]>
</ui-access>
<license-agreement>
<![CDATA[My License agreement]]>
</license-agreement>
<files>
<file source = "MyLibrary.swc" destination = "$flash/Libraries" shared="true"/>
<file source = "bin/Add path to  My Library.jsfl" destination = "$flash/Commands" shared="true"/>
</files>
</macromedia-extension>

The “Add path to  My Library.jsfl” command file:

var myDoc = fl.getDocumentDOM();
myDoc.libraryPath = "$(UserConfig)/Libraries;" + myDoc.libraryPath;
fl.trace("class path: "+myDoc.libraryPath);

Use the Extension Manager to package the mxi file. This will create a mxp file that you can distribute.

Digital signage, Kiosks, cell phones and AIR

Posted in Uncategorized with tags , , , on November 6, 2009 by andkrup

I just thought: What if you could go to a record store, see the latest music videos on the big displays, buy the music via an interactive AIR application on the touchscreens  and transfer it to your iphone via bluetooth (or similar).

Why would you bother when you would be able to do exactly the same thing at home on the iTunes store?

Is digital signage something that will sprout and demand new exciting Rich (Internet?) Applications, or will evolution in mobile phones kill it off?

There is probably a big difference in selling physical and non-physical commodities. I assume Digital signage is a good thing (seen from an advertisers point of view) when the client is selling non-digital products. He needs a physical outlet. A store.

But then the creative guy will ask: Ok, people talk about how Digital signage delivers several advantages and all. I would like to do something new and unexpected. I’d like to do something interactive, cross some digital domains, maybe let people get something digital of value while at the physical store, that they can’t get at home while on the internets.

hmmm… this could spin some heads