Skip to content

Instantly share code, notes, and snippets.

View ElRochito's full-sized avatar
🏠
Working from home

Julien ElRochito

🏠
Working from home
View GitHub Profile
@2ec0b4
2ec0b4 / listener.php
Created December 13, 2019 10:38
PostgreSQL Notifier with a PHP Listener
<?php
set_time_limit(0);
$db = new PDO(
'pgsql:dbname=dbname host=host port=5432;options=--application_name=APPLICATION_NAME',
'user',
'password',
[
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
@rhukster
rhukster / sphp.sh
Last active March 30, 2024 10:41
Easy Brew PHP version switching (Now moved to https://github.com/rhukster/sphp.sh)
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
#
# >>> IMPORTANT: Moved to: https://github.com/rhukster/sphp.sh
# >>> Kept here for legacy purposes
#
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
@zeshanshani
zeshanshani / acf_options_multilingual.php
Last active October 10, 2023 11:25
Creates separate Advanced Custom Fields options pages for the specified languages.
<?php // Don't copy this line if you are inserting in a file that has it already.
/**
* ACF Options Page
*
* Instructions:
* Add more languages to the array below: $languages
*
* @author: Zeshan Ahmed <https://zeshanahmed.com/>
*/
@2ec0b4
2ec0b4 / myservice
Last active May 8, 2017 12:48 — forked from bramus/myservice
Running a PHP script as a service/daemon using `start-stop-daemon`
#! /bin/sh
# Installation
# - Move this to /etc/init.d/myservice
# - chmod +x this
#
# Starting and stopping
# - Start: `service myservice start` or `/etc/init.d/myservice start`
# - Stop: `service myservice stop` or `/etc/init.d/myservice stop`
@jexchan
jexchan / github.css
Created September 3, 2012 03:02 — forked from andyferra/github.css
Github Markdown CSS - for Markdown Editor Preview
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"