Skip to content

Instantly share code, notes, and snippets.

View fritz-gerneth's full-sized avatar

Fritz Gerneth fritz-gerneth

  • funct GmbH
  • Munich
View GitHub Profile
<?php
/**
* Created by PhpStorm.
* User: Fritz Gerneth
* Date: 17.03.2016
* Time: 17:38
*/
namespace Application;
if(function_exists('add_shortcode_param'))
{
add_shortcode_param('icon_manager', array($this,'icon_manager'));
}
// Generate param type "number"
if ( function_exists('add_shortcode_param'))
{
add_shortcode_param('number' , array(&$this, 'number_settings_field' ) );
}
// Generate param type "heading"
function funct_vcExtension_tabDeepLink_tabIDChanged()
{
jQuery('.funct_vcExt_deepLink_tabId').text(jQuery('.tab_id_field').val());
}
if ((log != null) && (log.isErrorEnabled())) {
log.error("Critical error in controlcycle of agent: " + getAgentName() + ". Stopping Agent! Exception: ", e);
} else {
System.err.println("Critical error in controlcycle of agent: " + getAgentName()
+ ". Stopping Agent. Exception: ");
e.printStackTrace();
}
@fritz-gerneth
fritz-gerneth / Extremy simple DDP-Proxy
Created May 24, 2013 22:06
Extremy simple DDP-Proxy
var http = require('http');
var sockjs = require('sockjs');
var WebSocket = require('ws');
var proxy = sockjs.createServer();
proxy.on('connection', function(conn) {
var client = new WebSocket('ws://192.168.178.59:3000/sockjs/websocket');
client.on('open', function() {
console.log('Proxy -> Server', 'connected');
});
@fritz-gerneth
fritz-gerneth / 1
Created May 9, 2013 22:09
Bootstrap Typeahead
Template['project.index'].rendered = function () {
"use strict";
$('#project-index-add-member').typeahead({
source: function (query, process) {
Meteor.subscribe('user.emails', query, function () {
var mailsResult = Meteor.users.find({
"emails.address": new RegExp(query)
}).fetch();
var mails = [];
var MyEntityValidator = function (animal) {
if (!animal.name) {
return false;
}
// ...
return true;
}
var initial = true;
var handle = query.observeChanges({
added: function (id, user} {
if (!initial) doSomeAction();
}
});
intial = false;
(function (InnoAccel, _) {
"use strict";
InnoAccel.Application = function (instances) {
var self = this,
services = instances || {},
registeredModules = [];
if (!services.request) {
Template.freeboxes.hasErrorBoxes = function () {
return (Freeboxes.find({yourConditionInHere}).count() > 0);
};