Skip to content

Instantly share code, notes, and snippets.

View Konafets's full-sized avatar

Stefano Kowalke Konafets

View GitHub Profile
@dupuy
dupuy / README.rst
Last active June 25, 2024 15:05
Common markup for Markdown and reStructuredText

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

@jsuar
jsuar / d3 Packing Example
Created February 1, 2013 17:01
d3 packing example with squares and text.
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<style>
circle, rect {
stroke: #000;
fill-opacity: .1;
}
@markhowellsmead
markhowellsmead / DownloadPDF.html
Created April 9, 2015 12:26
TYPO3: Link to a PDF in Fluid using a FAL field
# BE
<flux:field.inline.fal name="downloadFile" multiple="FALSE" allowedExtensions="pdf" />
# FE
<v:variable.set name="downloadFile" value="{v:content.resources.fal(field: 'downloadFile') -> v:iterator.first()}"/>
<a class="downlow" href="{downloadFile.url}">Download</a>
@jwalton512
jwalton512 / gulpfile.js
Created June 4, 2015 14:25
elixir+less+scripts+browserify+version
elixir(function (mix) {
mix.less('app.less')
.less('admin.less')
.scripts(['libs/**/*.js', 'app/**/**/*.js'], 'resources/assets/build/app.js')
.browserify('app.js', 'public/js/app.js', 'resources/assets/build')
.version('js/app.js')
});
@smichaelsen
smichaelsen / DateInterval.php
Last active November 26, 2015 09:19
Example how to use the TypeInterface to let extbase initialize objects from your database records
<?php
namespace AppZap\MyExt\Type;
use TYPO3\CMS\Core\Type\TypeInterface;
/**
* In our application we have fields that store time intervals as minutes in the database.
* In our code we want proper DateInterval objects, so we use a TypeInterface to let extbase take care of the conversion.
*
* Usage example on a model property:
@azimidev
azimidev / _Laravel_Queue_Supervisor_Instruction.md
Last active November 15, 2022 14:42 — forked from danharper/a.md
Laravel Queue Supervisor

Install Supervisor with sudo apt-get install supervisor in Unix or brew install supervisor in Mac OSX. Ensure it's started with sudo service supervisor restart in Unix or brew services start supervisor in Mac OSX.

In Unix in /etc/supervisord/conf.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

In Mac OSX first run supervisord -c /usr/local/etc/supervisord.ini and in /usr/local/etc/supervisor.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

This file points at /usr/local/bin/run_queue.sh, so create that file there. Give this execute permissions, too: chmod +x run_queue.sh.

Now update Supervisor with: sudo supervisorctl reread in Unix and with: brew services restart supervisor in MAc OSX . And start using those changes with: sudo supervisorctl update.

0: Ohne BahnCard,
1: BahnCard 25, 1. Klasse,
2: BahnCard 25, 2. Klasse,
3: BahnCard 50, 1. Klasse,
4: BahnCard 50, 2. Klasse,
9: A - VORTEILScard (incl. RAILPLUS),
10: CH - HalbtaxAbo (incl. RAILPLUS),
11: CH - HalbtaxAbo (ohne RAILPLUS),
12: NL - Voordeelurenabo (incl. RAILPLUS),
13: NL - Voordeelurenabo (ohne RAILPLUS),
@tessi
tessi / my-way-to-postgresql-9-6-2-on-an-uberspace.md
Last active November 27, 2018 22:53
Upgrade Postgresql from 9.2 to 9.6 on an uberspace

Upgrade Postgresql from 9.2 to 9.6 on an uberspace

Uberspace (an awesome german web hoster) has superb postgresql support, except that it currently only offers postgresql versions 9.2.x and 9.3.x. I run postgresql 9.6.2 on my uberspace and documented steps for a migration to postgresql 9.6 here.

My goal was to be as close to the original uberspace-postgresql-setup as possible, but I had to copy and modify some uberspace scripts so they correctly use the new postgresql version.

Warning: Here be dragons. This is what I did -- that doesn't mean you should do the same or what I did was clever. Always backup your data and maybe test on a throw-away uberspace first. If you find things to improve, let me know and I'll try to keep this updated.

What I assume you have

@einpraegsam
einpraegsam / InsertExample.php
Last active February 21, 2024 13:23
TYPO3 QueryBuilder example use
<?php
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;
// insert into tt_content (header, crdate, pid) VALUES ("New content", 123456789, 123);
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_content');
$queryBuilder
->insert('tt_content')
->values([
'header' => 'New content',
@alfhh
alfhh / ga-video.js
Created July 10, 2017 20:17 — forked from kyleridolfo/ga-video.js
HTML5 Video Tracking for Google Tag Manager
<script>
// Let's wrap everything inside a function so variables are not defined as globals
(function(){
// This is gonna our percent buckets ( 10%-90% )
var divisor = 10;
// We're going to save our players status on this object.
var videos_status = {};
// This is the funcion that is gonna handle the event sent by the player listeners
function eventHandler(e){
switch(e.type) {