Skip to content

Instantly share code, notes, and snippets.

@joseluisq
joseluisq / vim_usefull_commands.md
Last active August 29, 2015 14:07
Vim usefull commands
  • gg — Move the cursor to the first line of the file.
  • G — Move the cursor to the last line of the file.
  • dd — Delete current line.
  • dG — Delete all lines of the file.
  • yy — Copy a line.
  • p — Paste the copied or deleted text after the current line.
  • P — Paste the copied or deleted text before the current line
  • u — Undo last change (can be repeated to undo preceding commands).
  • ctrl + R — Redo changes which were undone (undo the undos).
@joseluisq
joseluisq / ruby_sass_vs_libsass.md
Last active August 29, 2015 14:07
A Little Grunt Speed Comparatives between Libsass (C++) and Ruby Sass
Some Sass files compiled :

>> File "app/css/screen-small.css" changed.
>> File "app/css/screen-high-resolutions.css" changed.
>> File "app/css/screen-medium.css" changed.
>> File "app/css/screen-large.css" changed.
>> File "app/css/screen-default.css" changed.
>> File "app/css/helpers.css" changed.
@joseluisq
joseluisq / IE-match-comments.md
Last active August 29, 2015 14:07
Simply solution for IE comments matching to using Javascript RegExp.
@joseluisq
joseluisq / doctrine-entities-generator.sh
Created October 20, 2014 15:00
Linux shell script to generate entities for PHP Doctrine 2
#!/bin/sh
# Doctrine 2 Entities Generator v0.1
# ==================================
# Requirements
# ============
# It's necessary to create a composer project before exec this script.
# More info about composer at https://getcomposer.org/doc/00-intro.md
@joseluisq
joseluisq / bootstrap.php
Created October 20, 2014 15:18
Composer project to generate PHP Doctrine 2 models from database
<?php
// bootstrap.php
// Include Composer Autoload (relative to project root).
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
date_default_timezone_set('America/Lima');
require_once "vendor/autoload.php";
@joseluisq
joseluisq / groupingObjects.js
Created October 20, 2014 23:17
Javascript grouping array of object by key
function groupingObjects(groupBy, groupKey, list) {
var g = {}, e, i;
for (i = 0; i < list.length; ++i) {
e = list[i];
if (g[e[groupBy]] === undefined) {
g[e[groupBy]] = {};
g[e[groupBy]][group] = [];
}
@joseluisq
joseluisq / Preferences.sublime-settings
Last active August 29, 2015 14:08
Sublime Text 3 Predawn dark interface user settings
{
"color_scheme": "Packages/User/predawn (SL).tmTheme",
"theme": "predawn-DEV.sublime-theme",
// Typography
"font_face": "Office Code Pro",
"font_size": 10,
"font_options": ["no_round"],
"tab_size": 2,
"highlight_line": true,
"caret_style": "phase",
@joseluisq
joseluisq / nodejs_useful_commands.md
Created October 30, 2014 18:08
NodeJS useful commands

Set Python version for node-gyp

$ npm config set python python2.7
@joseluisq
joseluisq / nginx_installation_centos.md
Created November 1, 2014 05:39
Installing Nginx in CentOS 7

Installing Nginx in CentOS 7

To install Nginx in CentOS 7, run the commands below to download and save its repository.

$ rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

The above commands will download and save Nginx’s repository file into the default directory at /etc/yum.repos.d/

@joseluisq
joseluisq / 0readme.md
Last active July 19, 2022 20:20 — forked from plentz/nginx.conf
Best Nginx Configuration For Security

Best Nginx Configuration For Security

To generate your dhparam.pem file, run in the terminal

$ openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048