Skip to content

Instantly share code, notes, and snippets.

View lyrixx's full-sized avatar
😀

Grégoire Pineau lyrixx

😀
View GitHub Profile
@pborreli
pborreli / Instruction.md
Last active December 19, 2015 09:29
How to retrieve your GitHub Pull Request count using Google bigquery

Go to Google bigquery and execute the following query replacing XXX with your GitHub login

@lyrixx
lyrixx / refresh-assetic.sh
Last active August 29, 2015 13:56
Refresh assetic on any modification
#!/bin/bash
BASE_PATH=`dirname $0`/..
ASSETS_PATH=$BASE_PATH/app/Resources/assets
ASSETS_PATH2=$BASE_PATH/src/SensioLabs/Bundle/InsightAnalysisBundle/Resources/public
if [[ `which inotifywait` ]]; then
while true; do
inotifywait -r -e modify -e move -e create -e delete $ASSETS_PATH/ $ASSETS_PATH2/ | while read line; do
php $BASE_PATH/app/console assetic:dump --force
@lyrixx
lyrixx / segfault-finder.php
Last active August 15, 2023 21:17
How to find a segfault in PHP
<?php
register_tick_function(function() {
$bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
$last = reset($bt);
$info = sprintf("%s +%d\n", $last['file'], $last['line']);
file_put_contents('/tmp/segfault.txt', $info, FILE_APPEND);
// or
// file_put_contents('php://output', $info, FILE_APPEND);
});
@mxlje
mxlje / ssl.md
Last active January 10, 2022 02:03
SSL Certificate Commands

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

@qhwa
qhwa / go_port_forwarding.go
Last active March 27, 2024 13:17
network port forwarding in go lang
package main
import (
"fmt"
"io"
"net"
)
func main() {
ln, err := net.Listen("tcp", ":8080")
<?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;
@lyrixx
lyrixx / Queue.php
Last active March 15, 2019 14:56
PHP async queue (Process (or not))
<?php
class Queue
{
private $size;
private $onJobStart;
private $isJobRunning;
private $onJobFinish;
private $queued;
@chanmix51
chanmix51 / arrays_in_bash.md
Last active April 2, 2020 18:26
Using arrays in Bash

Using arrays in bash

creating an array

$> my_array=(one two three)

accessing/setting elements

$> echo ${my_array}

one

@lyrixx
lyrixx / run.php
Last active November 9, 2023 13:51
Updated your templates with the new twig include
<?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;
@lyrixx
lyrixx / HardCoreDebugLogger.php
Last active April 19, 2024 13:47
Hardcore Debug Logger
<?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);