Skip to content

Instantly share code, notes, and snippets.

View sinner's full-sized avatar
:electron:
Crafting

José Gabriel González Pérez sinner

:electron:
Crafting
View GitHub Profile
@sinner
sinner / app.js
Created December 20, 2015 18:57 — forked from branneman/app.js
Node.js application entry-point files
#!/usr/bin/env node
'use strict';
var spawn = require('child_process').spawn;
var args = [
'--harmony',
'app/bootstrap.js'
];
@sinner
sinner / DatabaseDriver.php
Last active October 31, 2015 18:52
Symfony Import Mapping Entities Fix
<?php
/*
* doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
@sinner
sinner / Ldap.php
Last active August 29, 2015 13:58
LDAP Autheticate
<?php
/**
* La Clase LDAP permite abstraer una conexión con un servidor de autenticación LDAP
* Esta Clase permite autenticarse a través de un servidor LDAP así como obtener datos
* del Servidor.
*
* @author José Gabriel González <jgabrielsinner10@gmail.com>
* @createdAt 2012-02-17
* @editedAt 2012-08-24
@sinner
sinner / 0_reuse_code.js
Created February 7, 2014 13:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@sinner
sinner / sgc
Created February 4, 2014 11:17
Configuration Server File with Apache for a Symfony2 Project called sgc
<VirtualHost *:80>
ServerName sgc
ServerAlias sgc sgc.dev sgc.com.ve
SetEnv SYMFONY__DATABASE__USER "postgres"
SetEnv SYMFONY__DATABASE__PASSWORD "postgres"
DocumentRoot "/var/www/sgc/web"
DirectoryIndex app.php
@sinner
sinner / ComandosSymfony2.sh
Last active June 14, 2017 19:30
Some Symfony 2 Commands
# Este comando funciona para descargar una versión de Symfony2 (2.1.3) y crear un proyecto con el framework. Descarga todos los vendors preconfigurados.
composer create-project symfony/framework-standard-edition myproject/ 2.1.3
# Este comando permite generar un nuevo bundle dentro del proyecto symfony2
php app/console generate:bundle --namespace=Sgi/CommonBundle --format=yml
# Este comando permite que la función assets vincule correctamente los recursos
php app/console assets:install web
# comando que permite limpiar la caché
@sinner
sinner / MenuItem.php
Created December 18, 2013 23:45
This is a way to make Selects Nested or Subqueries with DQL on Symfony 2.3. First I show you the entities relateds in the Subqueries facts on the Repository.
<?php
// Acme/DemoBundle/Entity/MenuItem.php
namespace Acme\DemoBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Generated by Symfony2 Console
<?php
abstract class BaseModelManager {
protected $em;
protected $class;
protected $repository;
protected $container;
/**
* Constructor.
@sinner
sinner / .htaccess
Created August 22, 2013 15:35
.htaccess Simple Apache Conf Rewrite Module
<VirtualHost *:80>
ServerName sgc
ServerAlias sgc sgc.dev sgc.com.ve
SetEnv SYMFONY__DATABASE__USER "postgres"
SetEnv SYMFONY__DATABASE__PASSWORD "postgres"
DocumentRoot "/var/www/sgc/web"
DirectoryIndex app.php
@sinner
sinner / bigFourVersion.html
Created May 15, 2013 22:23
Pure CSS Scrollable Table with Fixed Header Using CSS to allow scrolling within a single HTML table
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<title>Pure CSS Scrollable Table with Fixed Header</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="language" content="en-us" />
<script type="text/javascript">
<!--
/* http://www.alistapart.com/articles/zebratables/ */
function removeClassName (elem, className) {
elem.className = elem.className.replace(className, "").trim();