Skip to content

Instantly share code, notes, and snippets.

View pitpit's full-sized avatar

Damien Pitard pitpit

  • Recommerce
  • Paris, Nantes, Bucarest
  • X @pitpit_o
View GitHub Profile
@pitpit
pitpit / gist:2406318
Created April 17, 2012 14:29
Change file and directory persmissions recursively
find . -type f -print | xargs chmod 644
find . -type d -print | xargs chmod 755
@pitpit
pitpit / Sublime Text 2 URL Launcher.md
Created September 13, 2012 09:23
Create an URI protocol (edit://) in OSX to directly edit a file from browser to Sublime Text 2

This step by step explains how to create an URI protocol (a scheme) to directly edit a file in Sublime Text 2 from browser (or from the terminal).

Then it explains how to add this kind of link to Symfony2 Exceptions in order to allow opening file directly when an Exception is thrown.

Designed for OSX

Create the URI launcher for "edit://" URI

Launch AppleScript and save the following script as an Application (name it "Sublime Text 2 URL Launcher"):

```
$ sudo named-checkconf /etc/named.conf
$ sudo named-checkzone local /var/named/local.zone
zone local/IN: loaded serial 45
OK
```
```
sudo launchctl load -w /System/Library/LaunchDaemons/org.isc.named.plist
```
@pitpit
pitpit / syncany-osx-install.md
Last active August 29, 2015 14:01
Install Syncany on OSX
@pitpit
pitpit / mailcatcher-install.md
Last active November 21, 2022 04:45
Install Mailcatcher on OSX - works well with macOS Sierra High 10.12.X

05/25/2018: tested with macOS Sierra High 10.12.6

08/04/2020: added @mayesa's suggestion to fix an exception with EventMachine 08/04/2020: tested with macOS Catalina 10.15.5

Install MailCatcher:

brew install ruby
sudo gem install mailcatcher
@pitpit
pitpit / howto.md
Created April 1, 2015 09:22
HTTPS avec le serveur de dev PHP (en utilisant stunnel)

Installer puis lancer un serveur de dev en HTTPS grâce à stunnel

brew install stunnel
cd /usr/local/etc/stunnel
openssl genrsa -out key.pem 2048
openssl req -new -x509 -key key.pem -out cert.pem -days 1095
cat key.pem cert.pem >> stunnel.pem

chmod 600 stunnel.pem
@pitpit
pitpit / gist:4cc2a9a725e05fdc8428
Last active August 29, 2015 14:19
Setup SSL from Synalabs with nginx
@pitpit
pitpit / xsendfile-on-osx.md
Last active February 16, 2018 05:33
Install XSendFile on OSX 10.8.* or 10.10.*

Download and unpack module:

cd /tmp
wget https://github.com/nmaier/mod_xsendfile/archive/0.12.tar.gz
tar -xzvf 0.12.tar.gz

Fix apxs:

@pitpit
pitpit / keybase.md
Created September 23, 2016 12:52
keybase.md

Keybase proof

I hereby claim:

  • I am pitpit on github.
  • I am pitpit (https://keybase.io/pitpit) on keybase.
  • I have a public key ASA1DHiBiASOluxiyego_rPd8HXs9a2Tql1HL4PDK3hjMQo

To claim this, I am signing this object:

@pitpit
pitpit / cowsay
Last active March 15, 2018 14:15
#!/bin/bash
brew install cowsay &> /dev/null
cowsay "good"