Skip to content

Instantly share code, notes, and snippets.

View socketz's full-sized avatar
📵
I may be slow to respond.

socketz socketz

📵
I may be slow to respond.
View GitHub Profile
@socketz
socketz / 0_nginx_example_config.md
Last active August 8, 2018 02:57
Prestashop 1.6.x + Nginx 1.13.x + PHP-FPM 7.0 + SSL Let's Encrypt Configuration Example

Prestashop 1.6.x + Nginx 1.13.x + PHP-FPM 7.0 + SSL Let's Encrypt

Place the files on next paths or other and replace in the files below:

  • /data/nginx/config/global/acme-challenge.conf
  • /data/nginx/config/global/restrictions.conf
  • /data/nginx/config/global/expires.conf
  • /data/nginx/config/snippets/ssl-params.conf
  • /data/nginx/config/conf.d/example.com.conf
@socketz
socketz / pip-full-update.sh
Created February 24, 2017 20:20
pip update all packages
#!/bin/env bash
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
@socketz
socketz / post-update
Created January 25, 2016 12:14
post-update file for git push deployment
#!/bin/sh
#
# This hook does two things:
#
# 1. update the "info" files that allow the list of references to be
# queries over dumb transports such as http
#
# 2. if this repository looks like it is a non-bare repository, and
# the checked-out branch is pushed to, then update the working copy.
# This makes "push" function somewhat similarly to darcs and bzr.
@socketz
socketz / factory_pattern_example.php
Last active August 29, 2015 14:05
Factory Pattern: Example of class inheritance, using a Factory constructor for components
/*
This is a snippet of code, using a Factory class constructor with modules of apps,
it's a simple but effective architecture, the differents apps can use other patterns internally
*/
<?php
class AppComponent {
private $myVar;
public function __construct(){
@socketz
socketz / scrollbar_width.js
Created June 21, 2014 00:36
Get the scrollBar browser width tested on jQuery 1.8.3 IE7/8/9 Compatible
//Use this code to know the browser scrollbar width, for better calculation that you'll need in some cases
//jQuery dependency
function scrollbarWidth() {
var div = $('<div class="divSize1" style="width:50px;height:50px;overflow:hidden;position:absolute;top:-200px;left:-200px;"><div class="divSize2" style="height:100px;"></div>');
$('body').append(div);
div.css('overflow-y', 'scroll');
res = $('.divSize1').outerWidth() - $('.divSize2').outerWidth();
$(div).remove();
return res;
@socketz
socketz / css3_separator.css
Last active August 29, 2015 14:02
CSS3 Separator
.separator1 {
border-bottom: 1px solid rgba(255, 255, 255, 0.9);
border-radius: 100% 100% 100% 100%;
border-top: 1px solid rgba(150, 150, 150, 0.9);
box-shadow: 0 2px 10px 0 #444, 0 4px 5px 0 #ccc;
display: block;
height: 0;
margin-bottom: 20px;
margin-top: 15px;
width: 100%;