Skip to content

Instantly share code, notes, and snippets.

View SergeyMiracle's full-sized avatar

SergeyMiracle SergeyMiracle

  • Canada
View GitHub Profile
@SergeyMiracle
SergeyMiracle / nginx_auto_start.sh
Created January 13, 2017 04:42 — forked from aymanosman/nginx_auto_start.sh
Nginx: Start nginx on boot on Mac
# brew install nginx
sudo ln -s /usr/local/opt/nginx/homebrew.mxcl.nginx.plist /Library/LaunchDaemons/
sudo chown root:wheel /usr/local/opt/nginx/homebrew.mxcl.nginx.plist
sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
# Why do you need sudo?
# If you want nginx to be able to bind to port 80, it will need superuser privileges
@SergeyMiracle
SergeyMiracle / helpers.php
Created September 13, 2016 13:15 — forked from Ellrion/helpers.php
Showing all database queries in Laravel 5.2+
<?php
if (! function_exists('dbd')) {
/**
* Showing all database queries.
* Отображение всех запросов в базу.
*
* @param null|\Illuminate\Console\Command|\Psr\Log\LoggerInterface $channel
*/
function dbd($channel = null)
@SergeyMiracle
SergeyMiracle / services.js
Created January 9, 2016 15:31 — forked from bullgare/services.js
form serialization in pure js
serialize: function serialize(form)
{
if (!form || form.nodeName !== "FORM") {
return;
}
var i, j,
obj = {};
for (i = form.elements.length - 1; i >= 0; i = i - 1) {
if (form.elements[i].name === "") {
continue;
<?php
namespace ACompany\AnAppName\Dao\PdoImpl;
/**
* PDOConnection is a singleton implementation.
* getConnection() returning an instance of PDO connection.
*
* <code>
* Example usage: