Skip to content

Instantly share code, notes, and snippets.

DigitalDrifter digital-drifter

View GitHub Profile
@digital-drifter
digital-drifter / example.localhost.conf
Last active Oct 13, 2018
Nginx + PHP FPM + Webpack + Laravel
View example.localhost.conf
upstream fpm_sock {
server unix:/var/run/php7.2.9-fpm.sock;
}
server {
listen 80;
access_log /var/log/nginx/access.log;
return 301 https://$host$request_uri;
}
@digital-drifter
digital-drifter / gist:148b949b6433cde7aa1f6bbbac74ba1e
Created Aug 3, 2018
Install Vim 8 with Python, Python 3, Ruby and Lua support on Ubuntu 16.04
View gist:148b949b6433cde7aa1f6bbbac74ba1e
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev
#Optional: so vim can be uninstalled again via `dpkg -r vim`
sudo apt-get install checkinstall
sudo rm -rf /usr/local/share/vim /usr/bin/vim
cd ~
@digital-drifter
digital-drifter / cors.nginxconf
Created Jul 30, 2018 — forked from pauloricardomg/cors.nginxconf
Nginx configuration for CORS-enabled HTTPS proxy with origin white-list defined by a simple regex
View cors.nginxconf
#
# Acts as a nginx HTTPS proxy server
# enabling CORS only to domains matched by regex
# /https?://.*\.mckinsey\.com(:[0-9]+)?)/
#
# Based on:
# * http://blog.themillhousegroup.com/2013/05/nginx-as-cors-enabled-https-proxy.html
# * http://enable-cors.org/server_nginx.html
#
server {
@digital-drifter
digital-drifter / query.log.php
Created Jul 29, 2018
Laravel formatted query logging
View query.log.php
Event::listen(QueryExecuted::class, function (QueryExecuted $query) {
// Format binding data for sql insertion
foreach ($query->bindings as $i => $binding) {
if ($binding instanceof \DateTime) {
$query->bindings[ $i ] = $binding->format('\'Y-m-d H:i:s\'');
} else {
if (is_string($binding)) {
$query->bindings[ $i ] = "'$binding'";
}
}
View keybase.md

Keybase proof

I hereby claim:

  • I am digital-drifter on github.
  • I am digitaldrifter (https://keybase.io/digitaldrifter) on keybase.
  • I have a public key ASD5OJPyI6FBuUMjiq2KfZO5kGiK7Gu3JkiLlCNUTQ-o9wo

To claim this, I am signing this object:

You can’t perform that action at this time.