Skip to content

Instantly share code, notes, and snippets.

@dgrammatiko
dgrammatiko / ultimate-ut-cheat-sheet.md
Created March 16, 2017 04:27 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


<?php
public function loadTemplate($tpl = null)
{
// Clear prior output
$this->_output = null;
$template = JFactory::getApplication()->getTemplate();
$layout = $this->getLayout();
$layoutTemplate = $this->getLayoutTemplate();
// Create the template file name based on the layout
$file = isset($tpl) ? $layout . '_' . $tpl : $layout;
{
"title": "title",
"intro_text": "text-block",
"date": "text-block",
"main_text": "text-block"
}
var initCalendar = function()
{
var id = $(this).attr('id');
var btnId = id + "_btn";
$(btnId).setAttr('data-dayformat', "%Y-%m-%d");
$(btnId).setAttr('data-firstday', 1);
JoomlaCalendar.init( $(this).parent('.field-calendar')[0] );
@dgrammatiko
dgrammatiko / css-supports.js
Created May 22, 2017 17:37 — forked from codler/css-supports.js
CSS.supports() Polyfill
/*! CSS.supports() Polyfill
* https://gist.github.com/codler/03a0995195aa2859465f
* Copyright (c) 2014 Han Lin Yap http://yap.nu; MIT license */
if (!('CSS' in window)) {
window.CSS = {};
}
if (!('supports' in window.CSS)) {
window.CSS._cacheSupports = {};
window.CSS.supports = function(propertyName, value) {
@dgrammatiko
dgrammatiko / my.cnf
Created July 15, 2017 18:37 — forked from fevangelou/my.cnf
Optimized MySQL configuration for cPanel servers (updated July 2017)
# Optimized MySQL configuration for cPanel servers by Fotis Evangelou - Updated July 2017
#
# The settings provided below are a starting point for a 4GB - 8GB RAM server with 4 CPU cores.
# If you have less or more resources available you should adjust accordingly to save CPU,
# RAM and disk I/O usage.
# The settings marked with a specific comment or the word "UPD" after the value
# should be adjusted for your system by using MySQL DB diagnostics tools like:
# http://mysqltuner.com/
# or
# https://launchpad.net/mysql-tuning-primer (supports MySQL up to v5.6)

#Node - File Paths

##File Paths Node has a path module which can be used to manipulate paths.

###Normalizing Paths Paths can be stored in different ways and it is neccessary to ensure that the path is standardized.

var path = require('path');
path.normalize('/foo/bar//baz/asdf/quux/..');

Array<T>

Legend:

  • ✏️ method changes this.
  • 🔒 method does not change this.

Array<T>.prototype.*:

  • concat(...items: Array: T[] 🔒 ES3

Keybase proof

I hereby claim:

  • I am dgrammatiko on github.
  • I am dgrammatiko (https://keybase.io/dgrammatiko) on keybase.
  • I have a public key ASBZiLc6htQmRPSwVoRy1Do01lMMeu8Pkt3yZKCf3CbDaQo

To claim this, I am signing this object:

<!--
https://stackoverflow.com/questions/8917921/cross-browser-javascript-not-jquery-scroll-to-top-animation?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
-->
<p>Very long page.Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Very long page. Ver