Skip to content

Instantly share code, notes, and snippets.

@nowelium
nowelium / gist:1106112
Created July 26, 2011 06:25
Android Notification re-launching
var activityClassName = Ti.App.id + '.' + Ti.App.name.substring(0, 1).toUpperCase() + Ti.App.name.substring(1) + 'Activity';
var intent = Titanium.Android.createIntent({
//className: 'org.appcelerator.titanium.TiActivity',
//packageName: Ti.App.id,
className: activityClassName,
action: Titanium.Android.ACTION_MAIN,
flags: 0x10200000
});
intent.addCategory(Titanium.Android.CATEGORY_LAUNCHER);
@nowelium
nowelium / gist:1009104
Created June 5, 2011 16:09
what is "type"
Io 20080120
Io> Hoge := Object clone; Hoge type
==> Hoge
Io> Foo := "bar"; Foo type
==> Foo
Io> foo := "baz"; foo type
==> Sequence
Io>
@nowelium
nowelium / gist:999826
Created May 31, 2011 03:39
version.js
var Version = function(version){
var pos = version.indexOf('.');
var __major__ = version.substring(0, pos);
var __minor__ = version.substring(pos + 1);
if(__minor__.length < 2){
__minor__ = __minor__ + '0';
}
this.major = parseInt(__major__, 10);
@nowelium
nowelium / actor.js
Created March 27, 2011 15:01
javascript Actor: scala's actor style
Function.prototype.bind = function(obj){
var __method__ = this;
var __args__ = Array.prototype.slice.call(arguments);
__args__.shift(); // obj
return function (){
var args = Array.prototype.slice.call(arguments);
return __method__.apply(obj, __args__.concat(args));
};
};
@nowelium
nowelium / gist:751060
Created December 22, 2010 03:53
Arduino_SingleThread
#define D09 9
#define D10 10
#define D11 11
#define D12 12
class Context {
public:
unsigned long _current;
unsigned long _timeout;
void (*_callback)();
@nowelium
nowelium / gist:646307
Created October 26, 2010 04:25
final var(val) VS protected var(val)
/*
* Foo に a というフィールド定義(しかも代入できないよ)のつもりが...
*/
class Foo {
val a:String = "foo"
}
class Bar extends Foo {
override val a = "bar"
}
<VirtualHost *:80>
DocumentRoot /srv/www/teritori.at
ServerName teritori.at
LogLevel warn
ErrorLog "|logger -p local2.err -t httpd"
CustomLog "|logger -p local2.info -t httpd" combined
<Directory "/srv/www/teritori.at">
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json
Timeout 60
KeepAlive On
MaxKeepAliveRequests 20
KeepAliveTimeout 1
StartServers 80
MinSpareThreads 80
MaxSpareThreads 80
MaxClients 80
# syslog-ng configuration file.
#
# This should behave pretty much like the original syslog on RedHat. But
# it could be configured a lot smarter.
#
# See syslog-ng(8) and syslog-ng.conf(5) for more information.
#
options {
sync (1000);
# syslog-ng configuration file.
#
# This should behave pretty much like the original syslog on RedHat. But
# it could be configured a lot smarter.
#
# See syslog-ng(8) and syslog-ng.conf(5) for more information.
#
options {
sync (100);