Skip to content

Instantly share code, notes, and snippets.

Avatar
😀

Grégoire Pineau lyrixx

😀
View GitHub Profile
@lyrixx
lyrixx / README.md
Last active Feb 21, 2020
Add shared tracks in to slack to a Spotify Playlist
View README.md
@lyrixx
lyrixx / README.md
Last active Mar 17, 2020
Spotify does not handle Media Keys
View README.md

Debug media keys and Spotify

TL;DR: There is a bug in gnome that have been fixed in 3.3. But you can temporary fix this issue with: pkill gsd-media-keys

Let's Debug

  1. We check logs

@lyrixx
lyrixx / .gitignore
Last active Feb 26, 2020
UUID generation in PHP
@lyrixx
lyrixx / HardCoreDebugLogger.php
Last active May 31, 2022
Hardcore Debug Logger
View HardCoreDebugLogger.php
<?php
const STREAM_OPEN_FOR_INCLUDE = 128;
final class HardCoreDebugLogger
{
public static function register(string $output = 'php://stdout')
{
register_tick_function(function () use ($output) {
$bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
@lyrixx
lyrixx / run.php
Last active Oct 7, 2021
Updated your templates with the new twig include
View run.php
<?php
<<<CONFIG
packages:
- "symfony/finder: ~3.0"
- "symfony/console: ~3.0"
CONFIG;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
@chanmix51
chanmix51 / arrays_in_bash.md
Last active Apr 2, 2020
Using arrays in Bash
View arrays_in_bash.md

Using arrays in bash

creating an array

$> my_array=(one two three)

accessing/setting elements

$> echo ${my_array}

one

@lyrixx
lyrixx / Queue.php
Last active Mar 15, 2019
PHP async queue (Process (or not))
View Queue.php
<?php
class Queue
{
private $size;
private $onJobStart;
private $isJobRunning;
private $onJobFinish;
private $queued;
View run.php
<?php
<<<CONFIG
packages:
- "kriswallsmith/buzz: ^0.15.0"
- "symfony/console: ^3.2@dev"
CONFIG;
// Find you token on https://api.slack.com/docs/oauth-test-tokens
use Buzz\Message\Response;
@qhwa
qhwa / go_port_forwarding.go
Last active Jul 24, 2022
network port forwarding in go lang
View go_port_forwarding.go
package main
import (
"fmt"
"io"
"net"
)
func main() {
ln, err := net.Listen("tcp", ":8080")
@mxlje
mxlje / ssl.md
Last active Jan 10, 2022
SSL Certificate Commands
View ssl.md

These commands are needed every time you want to generate a new certificate signing request to give to an authority in order for them to generate and sign a certificate for you.

https://letsencrypt.org/ solves a lot of the pain involved with SSL certs, but sometimes you still need to go the "old school" route. I constantly forget how this stuff works, so I collected the most important commands (and what they do) here for easy copy & paste.

Generate new private key