Skip to content

Instantly share code, notes, and snippets.

View yoyosan's full-sized avatar
🏠
Working from home

Marius Palade yoyosan

🏠
Working from home
View GitHub Profile
@yoyosan
yoyosan / caching.php
Last active June 15, 2018 07:30
Object Caching using Decorators
<?php
// in App\Repo\Topic.php
interface Topic
{
public function topics();
}
// in App\Repo\TopicQuery.php
@yoyosan
yoyosan / gist:ab11dd34936d4e52b3cca313635bc537
Last active October 30, 2018 08:42
Text for keybr practice
public function toFormattedDateString()
protected static $translator;
*
* Add weeks to the instance. Positive $value travels forward while
*/
* Set last errors.
return $this->setDate($year, 12, 31)->endOfDay();
static::$weekStartsAt = $day;

F                                                                   1 / 1 (100%)

Time: 2.52 seconds, Memory: 34.00MB

There was 1 failure:

1) Tests\Unit\Dispatcher\Engine\BatchingTest::batching_selects_the_closest_order_to_the_current_one
Failed asserting that 255 matches expected 251.
@yoyosan
yoyosan / research_tech_documentation.md
Last active March 1, 2019 17:50
Research about how others do technical documentation
https://www.europosters.ro/never-give-up-motivational-quote-f112518765
https://www.europosters.ro/don-t-stop-when-you-re-tired-f163177255 - nu mai au varianta mea
https://www.europosters.ro/motivational-fitness-quote-f117808152
@yoyosan
yoyosan / emby-upgrade.md
Last active August 13, 2019 07:50
FreeNAS 11.2 - Update Emby server to recent release

Install through the web interface a fresh jail of EmbyServer.

Connect to the NAS through SSH:

iocage console emby
service emby-server stop
cd /tmp
# latest releases can be found here: https://github.com/MediaBrowser/Emby.Releases/releases
fetch https://github.com/MediaBrowser/Emby.Releases/releases/download/4.2.1.0/emby-server-freebsd11_4.2.1.0_amd64.txz
@yoyosan
yoyosan / revertzyxelz2.md
Last active December 13, 2022 07:30
Reverting from Open WRT to OEM firmware for Zyxel Armor Z2 NBG6817

Easyguide

I'm using Manjaro but this is valid for Arch.

Install atftp and net-tools. I'm using trizen and ohmyzsh aliases.

trin atftp net-tools
@yoyosan
yoyosan / cleancrap.md
Last active October 18, 2023 00:16
How to clean kdetmpdevfsi or .ICEd-unix suspicious files/folders or processes

Problem

I've recently been hacked on my VPS(using Centos 7.6 and CWP up to date) and the following files/folders were created:

  • /tmp/.ICEd-unix
  • /var/tmp/.ICEd-unix
  • /tmp/kdevtmpfsi
  • /var/tmp/kinsing

The following processes were running and using 100% CPU and Memory:

@yoyosan
yoyosan / Upload.php.md
Last active September 3, 2023 01:50
File upload example for Quasar framework
// Laravel 7 example

namespace App\Http\Controllers;

class Contact extends Controller
{
    // ...

    /**
@yoyosan
yoyosan / quasar-grid.sass
Last active October 11, 2023 15:46
Grid classes for Quasar framework - inspired from Tailwindcss
.grid
display: grid
// Grid template columns
.grid-cols-1
grid-template-columns: repeat(1, minmax(0, 1fr))
.grid-cols-2
grid-template-columns: repeat(2, minmax(0, 1fr))