Skip to content

Instantly share code, notes, and snippets.

View ktabori's full-sized avatar

Krisztian Tabori ktabori

  • Dixa Aps
  • Copenhagen, Danmark
View GitHub Profile
@ktabori
ktabori / common_scripts.html
Last active December 11, 2017 13:59
Common script for Dixa website and marketing stack
<!-- Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-67995954-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-67995954-2');
</script>
<!-- HubSpot -->

JavaScript API can be called via window._dixa object after the widget code, e.g. the api can be called with:

_dixa(function name{string}, parameter, ... parameter);

List of the available javascript API settings.:

Set the view of the widget

// view can be "conversation" or "minimized".
@ktabori
ktabori / Gruntfile.js
Created August 26, 2013 11:42
Grunt.js tasks for DR project
//Javascript based task management in Command Line
//Gruntfile.js for DR News Feed Reader
//Author: Krisztian Tabori <ktabori@me.com>
//More information about Grunt.js <http://gruntjs.com>
module.exports = function(grunt) {
grunt.initConfig({
concat: {
dist: {
@ktabori
ktabori / header.js
Created August 26, 2013 10:41
Background motion with mootools.
window.addEvent("domready",function() {
var scrollSpeed = 70;
var current = 0;
var direction = 'h';
function bgscroll(){
current -= 1;
$('#header').css("backgroundPosition", (direction == 'w') ? current+"px 0" : "0 " + current+"px");
@ktabori
ktabori / news.js
Last active December 21, 2015 17:19
Get news items from DR's JSON feed with mootools.
window.addEvent('domready', function(){
var itemContainer = document.id('topItemContainer');
if(itemContainer){
var addItems = function(items){
items.each(function(item){
@ktabori
ktabori / Base.cs
Last active December 21, 2015 05:39
/base API SUM
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using umbraco.presentation.umbracobase;
namespace Base
{
[RestExtension("Get")]
public class BaseClass
@ktabori
ktabori / Periódusok
Last active December 11, 2015 03:28
Periódusos dátum generálása PHP-ben.
<?php
function periodus( $datum, $tipus, $ismetlodes, $rendszeresseg )
{
$ido = date( 'H:i', strtotime( $datum ) );
$datum = date( 'Y-m-d', strtotime( $datum ) );
$datum = explode( '-', $datum );
$datumido = mktime( 0, 0, 0, $datum[1], $datum[2], $datum[0]);
//Ha a periodus típusa napi rendszerességű
@ktabori
ktabori / header probléma
Created January 11, 2013 09:37
'Cannot modify header information - headers already sent by...' probléma megoldása.
<!-----------------
++ Példa 1:
== Warning: Cannot modify header information - headers already sent by...
-----------------!>
<?php
//Hiba megjelenítése fejlesztés alatt
error_reporting(E_ALL);
//Teszt header() funkció előtt
@ktabori
ktabori / Hello World
Last active December 10, 2015 21:18
Hello World bjegyzés a blogomon...
<!DOCTYPE html>
<html>
<head>
<title>ktabori</title>
</head>
<body>
<?php
print 'Hello World!';
?>
</body>