Skip to content

Instantly share code, notes, and snippets.

@joseluisq
joseluisq / presentation-card.php
Created August 27, 2013 06:12
Creating a presentation card with GDImage
<?php
// https://github.com/joseluisq/gdimage
// Requiring the library
require 'GDUtils.php';
require 'GDImage.php';
require 'GDFigure.php';
require 'GDText.php';
require 'GDCanvas.php';
@joseluisq
joseluisq / Responsive-Matrix-Grid.markdown
Created January 21, 2014 04:38
A Pen by Jose Luis Quintana.
@joseluisq
joseluisq / sublime-text-3-x64.sh
Last active August 29, 2015 13:56
Sublime Text 3 Shell Installer for Fedora Linux x64
#!/bin/sh
# Sublime Text 3 Installer
# for Fedora Linux x64 (64 Bit)
# Miscellaneous
B=`tput bold`
N=`tput sgr0`
# Sublime Text 3 - Build 3083
@joseluisq
joseluisq / Download-Canvas-Example.markdown
Created February 25, 2014 17:50
A Pen by Jose Luis Quintana.
@joseluisq
joseluisq / change_datetime_format.php
Created March 15, 2014 03:15
Change format from string datetime
<?php
/**
* Change format from the datetime
* Example: changeDatetimeFormat('2014-11-02 09:11:00', 'd/m/Y H:i:s a');
*
* @param string $datetime String datetime
* @param string $format String datetime format
* @return string
*/
function changeDatetimeFormat($datetime, $format = 'Y-m-d H:i:s') {
@joseluisq
joseluisq / triangle_svg.html
Created March 17, 2014 03:41
SVG Triangle
<svg height="250" width="450">
<polygon points="225,10 100,210 350,210" style="fill:rgba(0,0,0,0);stroke:#609AAF;stroke-width:10" />
</svg>
@joseluisq
joseluisq / doctrine-entities-generator.bat
Created March 26, 2014 18:03
Windows Batch Doctrine 2 Entities Generator
@ECHO OFF
:: Windows Batch Doctrine 2 Entities Generator
:: by Jose Luis Quintana
:: -----------------------------------------------------------------
:: Previous installation via Composer
:: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/configuration.html
::
:: Yaml mapping directory: ./config/yaml
@joseluisq
joseluisq / mongodb-installer.sh
Last active August 29, 2015 14:00
MongoDB Installer for Red Hat Enterprise, CentOS or Fedora 64-bit system
#!/bin/sh
# Mongodb Shell 64-bit System Installer
# OS: Red Hat Enterprise, CentOS, Fedora or a related linux system.
# Miscellaneous
B=`tput bold`
N=`tput sgr0`
# Checks if package is installed on system
@joseluisq
joseluisq / check-package-installed.sh
Created April 22, 2014 06:48
How to check if some package is installed on linux system
#!/bin/sh
# This test uses the `type` command to check if package is installed.
# Tested on Fedora Linux x64
# Miscellaneous
B=`tput bold`
N=`tput sgr0`
# Package name
@joseluisq
joseluisq / toDateFromDatetime.js
Created June 2, 2014 03:02
Convert string datetime to Javascript Date object
/**
* Convert string datetime to Javascript Date object
* Eg. "2014-04-23 22:06:17".toDateFromDatetime()
*/
String.prototype.toDateFromDatetime = function() {
var parts = this.split(/[- :]/);
return new Date(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]);
};