Skip to content

Instantly share code, notes, and snippets.

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
@dgrammatiko
dgrammatiko / get_latest_release.sh
Created May 26, 2018 14:26 — forked from lukechilds/get_latest_release.sh
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@dgrammatiko
dgrammatiko / raspi-setup-gitea.md
Created July 12, 2018 16:28 — forked from mirhec/raspi-setup-gitea.md
Installing Gitea on Raspberry Pi with nginx, SSL and automatic backups

Setup Gitea on Raspberry Pi (3)

These instructions are based on this article: https://www.alexruf.net/2016/05/23/setup-gogs-git-service.html.

Setup Raspberry Pi with minimal Raspbian image. You need to connect to the HDMI port and set the following:

sudo raspi-config

There you need to enable the SSH server and you should change the hostname.

@dgrammatiko
dgrammatiko / localhost-ssl-certificate.md
Created September 7, 2018 20:50 — forked from ethicka/localhost-ssl-certificate.md
Localhost SSL Certificate on Mac OS Sierra and High Sierra

This gives you that beautiful green lock in Chrome. I'm assuming you're putting your SSL documents in /etc/ssl, but you can put them anywhere and replace the references in the following commands. Tested successfully on Mac OS Sierra and High Sierra.

Set up localhost.conf

sudo nano /etc/ssl/localhost/localhost.conf

Content:

[req]
@dgrammatiko
dgrammatiko / raspi-setup-gitea.md
Last active November 8, 2018 22:26 — forked from afragen/raspi-setup-gitea.md
Installing Gitea on Raspberry Pi 3 b+ with nginx and automatic backups
@dgrammatiko
dgrammatiko / myclass.php
Created August 15, 2019 11:33 — forked from iggyvolz/myclass.php
Demo of PHP Preload
<?php
echo "myclass.php required".PHP_EOL;
class MyClass
{
public function MyFunction():void
{
echo "This is a function!".PHP_EOL;
}
}