Skip to content

Instantly share code, notes, and snippets.

View empirefx's full-sized avatar

EFEX empirefx

  • Argentina, Santa Fe
View GitHub Profile
@empirefx
empirefx / gist:1479847
Created December 15, 2011 04:28
Error mysql
<?php
// Para que muestre por pantalla el error mysql.
$numresults=mysql_query($query);
if (!$numresults){
die (mysql_error());
}
?>
@empirefx
empirefx / gist:1510484
Created December 22, 2011 14:30
index
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Quis Nostrud</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<style type="text/css">
p{
background-color:#FFFBDB;
padding:5px;
@empirefx
empirefx / GIFEncoder.class.php
Created February 3, 2012 23:51
Captcha animado GIFEncoder
<?php
/*
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: GIFEncoder Version 2.0 by László Zsidi, http://gifs.hu
::
:: This class is a rewritten 'GifMerge.class.php' version.
::
:: Modification:
:: - Simplified and easy code,
<?xml version="1.0" encoding="utf-8"?>
<Event status="happened">
<Song title="Physical">
<Artist name="Olivia Newton John" ID="338221">
</Artist>
<Info StartTime="21:44:11" JazlerID="4806" PlayListerID="" />
</Song>
<Song title="Be My Baby">
<Artist name="Vanessa Paradis" ID="336452">
</Artist>
@empirefx
empirefx / get.php
Created February 4, 2012 00:13
Lyrics XML
<?php
/* Obtenemos $artista y $cancion enviados mediante jquery */
$artista = urlencode($_GET['artista']);
$cancion = urlencode($_GET['cancion']);
/* Enviamos la peticion al sitio api.chartlyrics.com y este
nos responde con formato xml */
$url = "http://api.chartlyrics.com/apiv1.asmx/SearchLyricDirect?artist=$artista&song=$cancion";
$str = file_get_contents($url);
echo $str;
//RESULTADO http://img233.imageshack.us/img233/9224/65030479.jpg
@empirefx
empirefx / fb_connect.php
Created February 18, 2012 01:46
fb_connect.php
<?php
//...code...
// USE: Post wall in facebook page
//controller fb_connect.php
public function __construct()
{
$CI = & get_instance();
$CI->config->load("facebook",TRUE);
$config = $CI->config->item('facebook');
parent::__construct($config);
@empirefx
empirefx / gist:6144628
Created August 3, 2013 01:10
Push element to bottom
#parent{
position: relative
}
#parent .child{
position: absolute;
bottom: 0;
}
@empirefx
empirefx / default.css
Last active August 29, 2015 13:56
Drag n drop in jquery
/* COLOR BACKGROUND */
blockquote{
background-color: #F7F7F7;
}
.layout-1{
background-color: #fff;
}
@empirefx
empirefx / controllerWelcome.php
Created February 6, 2014 21:43
Practicas con ci ajax jquery
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Welcome extends CI_Controller {
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
@empirefx
empirefx / ProccessIsRunningGnu.py
Last active August 29, 2015 13:57
ProccessIsRunning
import re
import subprocess
def is_running(process):
s = subprocess.Popen(["ps", "axw"],stdout=subprocess.PIPE)
for x in s.stdout:
if re.search(process, x):