Skip to content

Instantly share code, notes, and snippets.

jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
'use strict';
var gulp = require('gulp');
var typescript = require('gulp-tsc');
var mocha = require('gulp-mocha');
var growl = require('gulp-notify-growl');
var async = require('async');
var notify = growl();
var paths = {
$domains = parse_ini_file(__DIR__.'/../app/config/domains.ini');
$localDomainsFile = __DIR__.'/../app/local/domains.ini';
if(file_exists($localDomainsFile)) {
$localDomains = parse_ini_file($localDomainsFile);
$domains = array_merge($domains, $localDomains);
}
$site = $domains[filter_input(INPUT_SERVER, 'SERVER_NAME')];
define('SITE', $site);
{
"USD": "$",
"EUR": "€",
"GBP": "£",
"INR": "₹",
"AUD": "$",
"CAD": "$",
"SGD": "$",
"CHF": "CHF",
"MYR": "RM",
$di->set('translator', function() use ($config, $di) {
$locale = $di->get('locale');
$whitelist = ['de', 'en'];
$fallback = ['de', 'en'];
$chainResolver = new \Kdyby\Translation\LocaleResolver\ChainResolver;//new \LocaleResolver($locale);
$localeResolver = new \LocaleResolver($locale);
$chainResolver->addResolver($localeResolver);
const renderBooleanFeature = (packages, title, feature) => {
let tds = [];
for (let $package of packages) {
const data = $package[1];
const code = $package[0];
if (data.hasOwnProperty(feature) && data[feature] === true) {
tds.push(
<td key={code+feature} className={code}>
<span className="glyphicon glyphicon-ok"></span>
@bazo
bazo / ape.js
Created February 16, 2012 16:34
ape client
var apeConfig = {
domain: 'auto',
server: 'server.com:6969',
transport: 1,
}
var baseUrl = 'http://' + window.location.hostname;
if(window.location.port != 80)
{
{
"location": {
"type": "Polygon",
"coordinates": [
[
48.122033990283,
17.036580815472
],
[
48.211966009717,
@bazo
bazo / gist:5233194
Last active December 15, 2015 08:48
json to array conversion
GsonBuilder gsonBuilder = new GsonBuilder();
Gson inputGson = new Gson();
ArrayList<ArrayList<String>> list = inputGson.fromJson(json, ArrayList.class);
Coordinate[] coordinates = new Coordinate[list.size()];
for (int i = 0; i < list.size(); i++) {
coordinates[i] = new Coordinate(Double.parseDouble(list.get(i).get(0)), Double.parseDouble(list.get(i).get(1)));
}