Skip to content

Instantly share code, notes, and snippets.

View gander's full-sized avatar
🏠
It’s Not a Bug, It’s a Feature.

Adam Gąsowski gander

🏠
It’s Not a Bug, It’s a Feature.
  • Warsaw, Poland
  • 07:38 (UTC +02:00)
View GitHub Profile
C:\Windows\System32\DisplaySwitch.exe /internal
C:\Windows\System32\DisplaySwitch.exe /external
@gander
gander / shortcuts.md
Last active July 30, 2020 16:33
JetBrains Tips and Tricks
@gander
gander / AutoLinkerForGistCSV.js
Last active December 2, 2020 07:33
convert text into links in table cells
jQuery(() =>
jQuery('td').filter(function() {
return jQuery(this).text().match(/^https?:\/\/.+/);
}).each(function() {
const $this = jQuery(this);
$this.html(jQuery('<a>', {
href: $this.text(),
rel: 'noopener noreferrer',
target: '_blank'
}).text($this.text()));
@gander
gander / TerribleDateFixer.php
Last active December 3, 2020 11:59
Scary code showing how not to code. Found in production
<?php
class DateFixer {
public function fix(string $date): string {
$time = new DateTime($date);
$time->modify('+3 days');
return $time->format('Y-m-d');
}
}