Skip to content

Instantly share code, notes, and snippets.

<mx:VBox width="100%" height="100%">
<mx:Repeater id="rp" startingIndex="0" recycleChildren="false">
<flexlibContainer:WindowShade id="windowShade" width="100%" data="{rp.currentItem}" opened="false">
<flexlibContainer:headerRenderer>
<mx:Component>
<flexlibControl:CanvasButton
xmlns:mx="http://www.adobe.com/2006/mxml"
width="100%"
creationComplete="creationCompleteHandler(event)"
click="headerClickHandler(event)"
var sys = require('sys');
process.stdout.write(sys.inspect(pathExistsSync('test'), true, null) + "\n");
process.stdout.write(sys.inspect(pathExistsSync('--test--'), true, null) + "\n");
function pathExistsSync (path) {
var fs = require('fs');
try {
var stat = fs.statSync(path);
} catch (error) {
return (error.errno !== process.ENOENT);
# aerith@www2381u:~$ view .vhosts/llll.aerith.sc.conf
<VirtualHost *:80>
ServerName llll.aerith.sc
DocumentRoot /home/aerith/.sites/llll.aerith.sc/htdocs
ErrorLog /var/log/apache2/llll.aerith.sc.error.log
CustomLog /var/log/apache2/llll.aerith.sc.access.log vhost_combined
@aerith
aerith / gist:573142
Created September 10, 2010 05:15 — forked from sorah/gist:573131
<?php
array_map(function ($i) { $s=($i%3==0?'Fizz':'').($i%5==0?'Buzz':''); $s=($s=="")?$i:$s; print "${s}\n"; }, range(1,100));
@aerith
aerith / gist:644591
Created October 25, 2010 08:14
文字列が正規表現パターンかどうかをそれっぽく判別する関数。
<?php
/*
* 文字列が正規表現パターンかどうかをそれっぽく判別する関数。
*/
function regexpUses($pattern)
{
// See: http://php.net/manual/reference.pcre.pattern.modifiers.php
// See: http://php.net/manual/regexp.reference.delimiters.php
if (preg_match('@^([^\s\\\\a-z0-9])(?:.*?)\1(?:[imsxeADSUXJu]*)?$@mD', $pattern)) return true;
if (preg_match('@^\{(?:.*?)\}(?:[imsxeADSUXJu]*)?$@mD', $pattern)) return true;
@aerith
aerith / なかったことにしたい.user.js
Created October 26, 2010 10:21
JSDeferred 使って書き直さないとちゃんと動かないんじゃないかな?
// ==UserScript==
// @name FaceBook Auto Poke
// @namespace ns.aerith.sc
// @include http://www.facebook.com/*
// ==/UserScript==
(function () {
var target_id = 'pagelet_netego_pokes';
var container = document.getElementById(target_id);
@aerith
aerith / dispatcher.js
Created October 28, 2010 11:37
動けばいいな、動くかな。
var dispatcher = {
dispatchees: [],
connect: function (pattern, action, options) {
dispatcher.dispatchees.push({
pattern: pattern,
action: action,
options: options || {}
});
#!/bin/sh
perlbin=`which perl`
phpbin=`which php`
rubybin=`which ruby`
pythonbin=`which python`
if [ -x $perlbin ]; then
echo -n "==================================================\n"
echo "Perl Paths"
@aerith
aerith / Common.class.php
Created November 5, 2010 05:08
Ruby のソースほぼまるパク
<?php
namespace URI\RegExp\Pattern {
#
# Patterns used to parse URI's
#
# RFC 2396 (URI Generic Syntax)
# RFC 2732 (IPv6 Literal Addresses in URL's)
# RFC 2373 (IPv6 Addressing Architecture)
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx" width="400" minHeight="400" creationComplete="creationCompleteHandler(event)">
<fx:Script>
<![CDATA[
import mx.events.VideoEvent;
import mx.events.SliderEvent;
private var playheadTimeSliderDragging:Boolean = false;