Skip to content

Instantly share code, notes, and snippets.

### ADD RPM Forge repository
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm # Verifies the package
rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm
### APACHE
# Dependencies
<script>
/**
* Inicio de JS
*/
jQuery(function(){
/**
* cuando hagan click en el input de envasadora
*/
jQuery('#envasadora').blur(function(){
@kaioken
kaioken / gist:10739505
Last active August 29, 2015 13:59
Popular PHP
function get_sessionid(){
$result = NULL;
$sessionid = uniqid() . md5(mt_rand());
$result = set_action($sessionid, 'start');
return $result;
}
function get_premios_count(){
$result = NULL;
$result = mt_rand(1, 1000);
@kaioken
kaioken / gist:9538c5e1348e2150dd01
Last active August 29, 2015 14:12
Phalcon Cheat
// para hacer query directo de un modelo utilizando su phql
$model::query()
->where('field = :bindparam:')
->andWhere( "field2 = '1' ")
->bind( ['bindparam' => '2'] )
->order('field ASC')
->limit(10)
->cache(['key' => 'optionalifyouwant' , 'lifetime' => 'optionalalso'])
->execute();
@kaioken
kaioken / gist:db9f1568b35247488db6
Created January 23, 2015 17:58
Prueba de Arbol
Naruto Shippuuden (anime) (secuela)
--Naruto Shippuuden Movie 1 (anime) (recuento alterno)
---Naruto Shippuuden Movie 2: Kizuna (anime) (secuela)
----Naruto Shippuuden Movie 3: Hi no Ishi wo Tsugu Mono (anime) (secuela alternativa)
-----Naruto Shippuuden Movie 4: The Lost Tower (anime) (secuela)
------Naruto Shippuuden Movie 5: Blood Prison (anime) (secuela)
--Naruto Shippuuden Movie 6: Road to Ninja (anime) (universo alterno)
Rock Lee no Seishun Full-Power Ninden (anime) (derivado)
--Rock Lee no Seishun Full-Power Ninden Mou Iccho (anime) (secuela)
<?php
use Phalcon\Mvc\Controller;
class PeliculasController extends Controller
{
public function indexAction()
{
$peliculas = Peliculas::find();
foreach($peliculas as $pelicula){
@kaioken
kaioken / gist:43fb8b84ef9c8834cf51
Created February 17, 2015 06:35
Estilo de Documentacion
/*
* Las funciones deben llevar el standar de documentacion de esta manera , no lo estamos siguiendo.
* debemos definir los parametros @param tipo y nombre
* que devuelve la funcion @return
* y su descripcion como estan haciendo
*/
/**
* funcion prinicpal pork el index de esta shit suckea por ahora -_-
* @return void
@kaioken
kaioken / nginx.conf
Last active August 29, 2015 14:15 — forked from plentz/nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
<html>
<header>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
body { font-family: Tahoma, Arial, sans-serif; }