Skip to content

Instantly share code, notes, and snippets.

View arifsetiawan's full-sized avatar

arif setiawan arifsetiawan

View GitHub Profile
function format(str){
var args = arguments;
return str.replace(/{(\d+)}/g, function(match, number){
return args[parseInt(number) + 1];
});
}
BaseWidget::BaseWidget(QWidget *parent) :
QWidget(parent)
{
QVBoxLayout * l = new QVBoxLayout(this);
l->setContentsMargins(0, 0, 0, 0);
qmlRegisterType<SPageStatus>("AegisLabs", 1, 0, "PageStatus");
QmlApplicationViewer * viewer = new QmlApplicationViewer(this);
@arifsetiawan
arifsetiawan / snaplist
Created June 18, 2012 09:52
horizontal page list view
ListView {
id: contentView
anchors.fill: parent
highlightRangeMode: ListView.StrictlyEnforceRange
orientation: ListView.Horizontal
snapMode: ListView.SnapOneItem
clip: true
model: internalContentModel
@arifsetiawan
arifsetiawan / uploadsimple.js
Created November 28, 2011 17:27
upload form
var express = require('express');
// express setup
var app = express.createServer();
app.use(express.bodyParser());
app.get('/', function(req, res){
res.writeHead(200, {'content-type': 'text/html'});
res.end(
'<form action="/upload" enctype="multipart/form-data" method="post">'+