Skip to content

Instantly share code, notes, and snippets.

View kbariotis's full-sized avatar
🌏

Kostas Bariotis kbariotis

🌏
View GitHub Profile
@kbariotis
kbariotis / nginx.conf
Created February 4, 2016 21:25 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@kbariotis
kbariotis / Dockerfile
Created October 3, 2015 14:40 — forked from konklone/Dockerfile
Dockerfile for installing Ruby 2.0 and RVM
FROM ubuntu
MAINTAINER Eric Mill "eric@konklone.com"
# turn on universe packages
RUN echo "deb http://archive.ubuntu.com/ubuntu raring main universe" > /etc/apt/sources.list
RUN apt-get update
# basics
RUN apt-get install -y nginx openssh-server git-core openssh-client curl
RUN apt-get install -y nano
@kbariotis
kbariotis / what-forces-layout.md
Last active September 19, 2015 20:12 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@kbariotis
kbariotis / pg.js
Last active August 29, 2015 14:17
Wrapper around node-postgres
var BPromise = require('bluebird'),
pg = require('pg');
function Postgres(opts) {
this.host = opts.host;
}
Postgres.prototype.query = function(sql) {
return new BPromise(function(resolve, reject){
// --- Variables
// ---------------------------------------------------
// grid
$gutter: 10;
$max-width: 1100; // Max grid wrap width
$sm-column-count: 4;
$med-column-count: 6;
$lg-column-count: 12;
$mqs: 380; // small breakpoint
@kbariotis
kbariotis / getProductsBuyers.sql
Last active August 29, 2015 14:13
Magento's Product Buyers
SELECT DISTINCT o.customer_id, ce.email FROM sales_flat_order_item i
JOIN sales_flat_order o ON o.entity_id = i.order_id
JOIN customer_entity ce ON ce.entity_id = o.customer_id
WHERE o.customer_id IS NOT NULL
AND i.sku = 'PRODUCT_SKU'
@kbariotis
kbariotis / resources.md
Last active August 29, 2015 14:11
Magento Related Must Read Stuff for every beginner.
@kbariotis
kbariotis / validation.php
Last active August 29, 2015 14:07
Respect/Validation Example
<?php
require_once __DIR__.'/your/vendor/autoload.php';
use Respect\Validation\Validator;
/**
* This would be your Model class
**/
class User {
@kbariotis
kbariotis / error
Created October 3, 2014 20:17
Node . error
vagrant@precise32:~/app/wearetech.io$ node .
/home/vagrant/app/wearetech.io/back/models/user.model.js:68
default: __.partial(ModelMongo.defaultDate, config.users.emailConfirmati
^
TypeError: Cannot read property 'emailConfirmationExpires' of undefined
at Object.<anonymous> (/home/vagrant/app/wearetech.io/back/models/user.model
.js:68:63)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
@kbariotis
kbariotis / gist:8bce64d27aebc45fc738
Created July 17, 2014 18:18
Phing script to deploy clean Magento 1.9 setup (not finished)
<?xml version="1.0" encoding="UTF-8"?>
<project name="mageploy" default="prepare">
<target name="prepare">
<echo msg="Making directory ./tmp" />
<mkdir dir="./tmp" />
<if>