Skip to content

Instantly share code, notes, and snippets.

View Pictor13's full-sized avatar
🤹‍♂️
Juggling with curiosity

Igor Pellegrini Pictor13

🤹‍♂️
Juggling with curiosity
  • BerlinOnline Stadtportal GmbH & Co. KG
  • Berlin
View GitHub Profile
@KevinSchildhorn
KevinSchildhorn / GradleCheatSheet.md
Last active May 14, 2023 23:07
Gradle Cheatsheet

Flash Cards

Here is some quick references to code surrounding gradle

  • plugins - Where you define the plugins you want to use. (More Info)
  • repositories - A block that tells gradle where to look for items. (More Info)
  • pluginManagement - Where you define the projects plugins, contains plugins and repositories blocks. (More Info)
  • BuildScript - (Legacy for plugin) Defines repositories and dependencies for adding plugins. Can also be used to add variables such as versions that are used across the project. (More Info)
@mindplay-dk
mindplay-dk / php-chatgpt.md
Created December 12, 2022 10:29
Teaching ChatGPT new PHP syntax

I was curious if we could use ChatGPT to generate a new and better manual for PHP.

This example was interesting enough that I figured it was worth posting.

It looks like ChatGPT does not know PHP 8.1 - the latest version it seems to know is PHP 8.

When asked to explain the first class Callable(...) syntax (introduced in PHP 8.1) it does explain how to generate something that is functionally similar, using e.g. fn($car) => $car->drive() rather than $car->drive(...). So it understands the concept, it just doesn't know about the new syntax.

But here's the wild part: I then proceded to explain the new syntax to it, and asked it to explain again using the new syntax - and it did it. 😮

@sylvainfaivre
sylvainfaivre / thinkpad_cpu_throttling_lap_mode.md
Last active April 12, 2024 22:52
CPU throttling and "lap mode" on Lenovo Thinkpad laptops

CPU throttling and "lap mode" on Lenovo Thinkpad laptops

Test setup

Hardware : Lenovo Thinkpad P14s, Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz

Software : Ubuntu 21.10, Gnome 40.4.0, Linux 5.13.0

Background

@amerryma
amerryma / TestComponent-nock.test.tsx
Created May 19, 2022 15:55
Supabase Mocking (Regular Mocking vs API Nock)
import '@testing-library/jest-dom'
import { render } from '@testing-library/react'
import { renderHook } from '@testing-library/react-hooks'
import nock from 'nock'
import TestComponent from './TestComponent'
const mockResultData = [
{
@linderd
linderd / README.md
Last active March 13, 2024 19:06 — forked from timlinux/README.md
Linux on Thinkpad P14s Gen2 AMD / T14 Gen2 AMD

Linux (Fedora 35) on a Thinkpad P14s [T14] Gen2 AMD

These are my installation-tricks and notes for running Linux on a 2021 Thinkpad P14s Gen2 with AMD Ryzen 7 5850U. It should also be suitable for the Thinkpad T14 Gen2 AMD as they are technically the same modell.
Meanwhile there is also a good test on youtube and an entry in the arch-wiki, which also comments some points mentioned here.

Detailed specs

Shipped:

@joepie91
joepie91 / es-modules-are-terrible-actually.md
Last active April 25, 2024 08:34
ES Modules are terrible, actually

ES Modules are terrible, actually

This post was adapted from an earlier Twitter thread.

It's incredible how many collective developer hours have been wasted on pushing through the turd that is ES Modules (often mistakenly called "ES6 Modules"). Causing a big ecosystem divide and massive tooling support issues, for... well, no reason, really. There are no actual advantages to it. At all.

It looks shiny and new and some libraries use it in their documentation without any explanation, so people assume that it's the new thing that must be used. And then I end up having to explain to them why, unlike CommonJS, it doesn't actually work everywhere yet, and may never do so. For example, you can't import ESM modules from a CommonJS file! (Update: I've released a module that works around this issue.)

And then there's Rollup, which apparently requires ESM to be u

class Period {
constructor(year, month) {
this.year = year;
this.month = month;
}
next() {
return this.month + 1 > 11
? new Period(this.year + 1, 0)
: new Period(this.year, this.month + 1)
@jeyj0
jeyj0 / haskell-crash-course.org
Created September 7, 2020 17:27
Haskell Crash Course

Haskell Crash-Course

Hello, Haskell!

putStrLn

putStrLn "Hello, Haskell!"
@ragboyjr
ragboyjr / AbstractCrudDTOController.php
Last active February 15, 2024 13:16
Easy Admin 3 DTO Crud Controller
<?php
namespace App\EasyAdminExtensions\Controller;
use EasyCorp\Bundle\EasyAdminBundle\Config\Action;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
use EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto;
use EasyCorp\Bundle\EasyAdminBundle\Event\BeforeCrudActionEvent;
use EasyCorp\Bundle\EasyAdminBundle\Event\BeforeEntityPersistedEvent;
use EasyCorp\Bundle\EasyAdminBundle\Event\BeforeEntityUpdatedEvent;