Skip to content

Instantly share code, notes, and snippets.

@qoomon
qoomon / JsonbColumnType.kt
Last active Feb 12, 2021
Kotlin Exposed Postgres JsonColumnType
View JsonbColumnType.kt
package me.qoomon.examples
import kotlinx.serialization.KSerializer
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonConfiguration
import me.qoomon.examples.JsonbColumnType.Companion.JSONB
import me.qoomon.examples.JsonbColumnType.Companion.TEXT
import org.jetbrains.exposed.sql.*
import org.jetbrains.exposed.sql.Function
import org.jetbrains.exposed.sql.statements.api.PreparedStatementApi
@danslo
danslo / phpng-hhvm-sugarcrm.md
Last active Oct 4, 2020
PHPNG vs. HHVM - SugarCRM
View phpng-hhvm-sugarcrm.md

Zeev Suraski (Zend CTO) recently released some benchmarking figures comparing HHVM to PHPNG (and PHP 5.6). I was particularly interested in the results for SugarCRM. They show a 14-28% speed benefit in favor of PHPNG. I decided to investigate, and ran some basic benchmarks with siege.

It came up with the following results:

Trans/sec
PHPNG 24.12
HHVM 20.74
Diff. 16.29%
View wizardApp.html
<div ng-app="wizardApp">
<div ng-controller="WizardSignupController">
<h2>Signup wizard</h2>
<div ui-view></div>
</div>
</div>
<script type="text/javascript" src="/js/vendor/angular-ui-router/release/angular-ui-router.min.js"></script>
<script type="text/javascript">
angular.module('wizardApp', [
'ui.router',
@daschl
daschl / couchbase-php-2pc-advanced.php
Created Jul 21, 2012
Advanced Couchbase 2PC PHP Implementation
View couchbase-php-2pc-advanced.php
<?php
/**
* A more general PHP two-phase commit implementation.
*
* This assumes that we run on 5.3 or later.
*/
class TransactionException extends Exception {}
/**
@daschl
daschl / couchbase-php-2pc-simple.php
Created Jul 21, 2012
Simple Couchbase PHP 2PC Implementation
View couchbase-php-2pc-simple.php
<?php
/**
* Simple two-phase commit for PHP couchbase.
*
* Michael Nitschinger (@daschl, 2012)
*
* Additional Remarks
* ------------------
* - The Couchbase extension makes it currently pretty hard to write easy readable code when dealing with
* CAS (compared to the ruby adapter). This could certainly be improved with closures. I also found that
@bastman
bastman / CallbackVO.as
Created Nov 16, 2011
jsonrpc client (as3)
View CallbackVO.as
package com.application.rpc
{
/**
* ...
* @author seb
*/
public dynamic class CallbackVO extends Object
{
@bastman
bastman / JsonRpc Client (js)
Created Nov 10, 2011
advanced json-rpc server (php)
View JsonRpc Client (js)
JS Client using jquery ajax and json2.js
========================================
App.invokeRpc = function(method, params, callback)
{
var rpc = {
method:method,
params:params
};
@bastman
bastman / MySQLIDB Example
Created Nov 6, 2011
MySQLi simple dbclient standalone php
View MySQLIDB Example
//Example
//=======
ini_set("display_errors", true);
error_reporting(E_ALL|E_STRICT & ~E_NOTICE);
set_error_handler(function($errno, $errstr, $errfile, $errline){
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
});
$db = MySQLiDB::getInstance();