Skip to content

Instantly share code, notes, and snippets.

@gruz
gruz / signal-without-smartphone.md
Created October 1, 2021 05:46 — forked from szepeviktor/signal-without-smartphone.md
Install Signal without a smartphone
@gruz
gruz / test_video_mime_type.js
Last active October 10, 2018 23:16
Check which video formats are supported by the browser
var mime_types = [
'video/x-ms-asf',
'video/x-ms-wmv',
'video/x-ms-wmx',
'video/x-ms-wm',
'video/avi',
'video/divx',
'video/x-flv',
'video/mpeg',
'video/quicktime',
@gruz
gruz / some_joomla_extension.php
Created June 2, 2018 17:45
Joomla output SQL query
<?php
// Usage
echo $db->replacePrefix((string) $query) ;
// Example
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select( 'id' );
$query->from($db->quoteName('#__kunena_categories'));
$query->where($db->quoteName('parent_id') . '=' . $db->quote( $parent_id ));
@gruz
gruz / create_joomla_user_via_cli.php
Last active June 2, 2018 17:47
Joomla create user programmatically in CLI (command line)
<?php
....
class MyCliClass extends JApplicationCli
{
// ....
public function createUser( $name, $username, $password, $email )
{
$data = array(
'username' => $username,
'name' => $name,
@gruz
gruz / .php_cs
Last active April 27, 2018 08:38
Joomla phpcs and php-cd-fixer settings
<?php
$topFilesFinder = PhpCsFixer\Finder::create()
->in(array(__DIR__ . '/libraries'))
->files()
->depth(0);
$mainFinder = PhpCsFixer\Finder::create()
->in(
array(
__DIR__ . '/libraries/cms',
__DIR__ . '/libraries/joomla',