Skip to content

Instantly share code, notes, and snippets.

View piotrlewandowski's full-sized avatar

Piotr Lewandowski piotrlewandowski

View GitHub Profile
@piotrlewandowski
piotrlewandowski / languages-that-compile-to-js.md
Created September 3, 2023 16:00 — forked from matthiasak/languages-that-compile-to-js.md
Languages that compile to JS (from CoffeeScript wiki)

CoffeeScript Family (& Friends)

Family (share genes with CoffeeScript)
  • Coco A CoffeeScript dialect that aims to be more radical and practical, also acts as a test bed for features that get imported in CoffeeScript.
    • LiveScript is a fork of Coco that is much more compatible with CoffeeScript, more functional, and with more features.
  • IcedCoffeeScript A CoffeeScript dialect that adds support for await and defer keywords which simplify async control flow.
@piotrlewandowski
piotrlewandowski / torrents.md
Created September 25, 2022 17:48 — forked from shmup/torrents.md
transmission blocklist guide

Transmission Blocklist

The Transmission torrent client has an option to set a Blocklist, which helps protect you from getting caught and having the DMCA send a letter/email.

It's as simple as downloading and installing the latest client:

@piotrlewandowski
piotrlewandowski / middleware.ts
Created July 19, 2022 12:15 — forked from mhaecal/middleware.ts
Protected Routes Middleware NextJS 12
import { NextResponse } from 'next/server'
import type { NextRequest } from 'next/server'
export function middleware(req: NextRequest) {
// get cookie token
const hasToken = req.cookies.get('token')
// protected routes (admin routes)
if (req.nextUrl.pathname.startsWith('/admin')) {
if (hasToken) {
@piotrlewandowski
piotrlewandowski / AUTHORS.md
Created May 17, 2022 19:28 — forked from juliengdt/AUTHORS.md
AUTHORS.md template

Project Authors

This is where your explain when the project started, for which client, and list all devteams who contributes to it.

Project technical leads:

  • John Foo - position - City (Country)
  • Bar Doe - position - City (Country)
@piotrlewandowski
piotrlewandowski / aliases
Created April 27, 2022 15:39 — forked from quent01/aliases
CMDER aliases configuration
;= @echo off
;= rem Call DOSKEY and use this file as the macrofile
;= %SystemRoot%\system32\doskey /listsize=1000 /macrofile=%0%
;= rem In batch mode, jump to the end of the file
;= goto:eof
;= Add aliases below here
;= -----------------------------------------------------
;=
;= $$$$$$\ $$\ $$\ $$$$$$$\ $$$$$$$$\ $$$$$$$\
;= $$ __$$\ $$$\ $$$ |$$ __$$\ $$ _____|$$ __$$\
@piotrlewandowski
piotrlewandowski / gist:e19841a70d20738254188b5640de75cc
Created October 25, 2021 11:41 — forked from hay/gist:1351230
Enterprisify your Java Class Names!
<!doctype html>
<html>
<head>
<title></title>
<style>
body {
background: white;
text-align: center;
padding: 20px;
font-family: Georgia, serif;
@piotrlewandowski
piotrlewandowski / 149909-playlist_youtube-vlc3patch.lua
Created August 8, 2021 14:05 — forked from seraku24/149909-playlist_youtube-vlc3patch.lua
VLC 3.x compatibility patch for 149909-playlist_youtube.lua
--[[
Youtube playlist importer for VLC media player 1.1 and 2.0
Copyright 2012 Guillaume Le Maout
Authors: Guillaume Le Maout
Contact: http://addons.videolan.org/messages/?action=newmessage&username=exebetche
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or

How to connect PS3 controller on Mac OSX, PC, etc.

This is how you connect PS3 controller to Mac OSX, PC, etc. when previously connected to a PS3. You will need a Mini USB cable. Overcome your laziness, get up of your chair, and go get one!

A big misconception is that keep holding PS button will reset the controller's pairing. It DOES NOT! From my testings, the controller keeps paring with the last machine it was CONNECTED VIA A USB CABLE.

Here are the steps:

@piotrlewandowski
piotrlewandowski / watcher-stylelint.xml
Created April 22, 2021 00:43 — forked from stevensacks/watcher-stylelint.xml
WebStorm Stylelint File Watcher
<TaskOptions>
<TaskOptions>
<option name="arguments" value="$FileName$ --fix" />
<option name="checkSyntaxErrors" value="true" />
<option name="description" />
<option name="exitCodeBehavior" value="ERROR" />
<option name="fileExtension" value="css" />
<option name="immediateSync" value="false" />
<option name="name" value="Stylelint" />
<option name="output" value="$FileDir$" />
@piotrlewandowski
piotrlewandowski / invert-binary-tree.js
Created January 7, 2021 19:31 — forked from kidGodzilla/invert-binary-tree.js
Invert a Binary Tree in Javascript
// This problem was inspired by this original tweet by Max Howell:
// Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard so fuck off.
// So, let's invert a binary tree in Javascript
// Original Tree
// 4
// / \
// 2 7
// / \ / \