Skip to content

Instantly share code, notes, and snippets.

@luishdez
luishdez / CSS gradient cross browser
Created July 11, 2010 07:55
CSS gradient cross browser
background: #f78d1d;
background: -webkit-gradient(linear, left top, left bottom, from(#faa51a), to(#f47a20));
background: -moz-linear-gradient(top, #faa51a, #f47a20);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#faa51a', endColorstr='#f47a20');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $ticket_location);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-type: text/xml"));
$xml = "<ticket><comment><value>$value</value><is_public>$is_public</is_public></comment><uploads>$token</uploads></ticket>";
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
window.confirm = function(message, event) { customConfirm(message, event); }
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import BaseHTTPServer
class RequestHandler (BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET (self):
self.send_response(200)
self.end_headers()
self.wfile.write(self._get_status())
@luishdez
luishdez / .htaccess
Created October 17, 2010 17:29
301 redirect
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule ^(.*)$ http://www.example.com/$1 [R=permanent,L]
@luishdez
luishdez / csvToArray.js
Created October 25, 2010 00:37
CSV to Array
// This will parse a delimited string into an array of
// arrays. The default delimiter is the comma, but this
// can be overriden in the second argument.
function CSVToArray( strData, strDelimiter ){
// Check to see if the delimiter is defined. If not,
// then default to comma.
strDelimiter = (strDelimiter || ",");
// Create a regular expression to parse the CSV values.
@luishdez
luishdez / heatMapCanvas.js
Created October 25, 2010 00:39
heat Map javascript and Canvas
/*
Copyright (c) 2010, Patrick Wied. All rights reserved.
Code licensed under the BSD License:
http://patrick-wied.at/static/license.txt
*/
var heatmapApp = (function(){
// var definition
// canvas: the canvas element
// ctx: the canvas 2d context
@luishdez
luishdez / Find huge files
Created November 29, 2010 20:56
find huge files ( centos )
find /var -size +10000k -print0 | xargs -0 ls -lSh
@luishdez
luishdez / fixfooter.js
Created December 4, 2010 07:52
Fix footer striking theme
footer_fix = function() {
var w = jQuery(window).height();
var b = jQuery('body').height();
var o = jQuery('#page_bottom');
var h = parseInt(o.css('margin-top'));
if(w > b) {
o.css('margin-top', h + w-b);
}
else if(h>0) {
if(h-(b-w) >= 0) o.css('margin-top', h-(b-w));
/* --- TOC
01. GENERAL TYPOGRAPHY
1. CSS Reset
2. General
3. Lists Styles
4. Borders & Dividers
5. Tables
6. Forms
7. Images