Skip to content

Instantly share code, notes, and snippets.

Juan Carlos Alonso jcalonso

Block or report user

Report or block jcalonso

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jcalonso
jcalonso / bluehostDBBackup
Created May 1, 2014
Backup databases from bluehost
View bluehostDBBackup
#!/bin/sh
LOGFILE=/tmp/bluehost_backup.log
EXPECTED_ARGUMENTS=3
exec 6>&1 # Link file descriptor #6 with the standard output
exec > $LOGFILE # stdout sent to $LOGFILE
#Check script arguments
if [ $# -ne $EXPECTED_ARGUMENTS ]
then
echo "No arguments supplied."
View keybase.md

Keybase proof

I hereby claim:

  • I am jcalonso on github.
  • I am jcalonso (https://keybase.io/jcalonso) on keybase.
  • I have a public key whose fingerprint is 7199 39CF F6BE 64F0 5212 7808 C0C7 4DD9 7BF5 61C5

To claim this, I am signing this object:

View install_httpd.yml
---
# These tasks install http and the php modules.
- name: Install http and php etc
yum: name={{ item }} state=present
with_items:
- httpd
- php
- php-mysql
- git
@jcalonso
jcalonso / Vagrant.rb
Last active Dec 27, 2015
Example of a Vagrant file
View Vagrant.rb
Vagrant.configure("2") do |config|
config.vm.box = "Ubuntu-12.04-x86_64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :private_network, ip: "192.168.111.16"
config.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--memory", 256]
v.customize ["modifyvm", :id, "--name", "My [project name] Development machine"]
@jcalonso
jcalonso / gist:6018847
Created Jul 17, 2013
Convert from mpg or mov to flv with nice quality
View gist:6018847
ffmpeg -i <filename.mpg> -deinterlace -ar 44100 -r 25 -qmin 3 -qmax 6 <filename.flv>
source: http://www.johnrockefeller.net/using-ffmpeg-to-convert-mpg-or-mov-to-flv/
View diagonalScript.html
<script>
jQuery(function() {
jQuery('#allinone_bannerWithPlaylist_elegant').allinone_bannerWithPlaylist({
skin: 'elegant',
width: 850,
height: 400,
origThumbImgW: 90,
origThumbImgH: 90,
circleColor: "#c3a62e",
View _view.php
<?php
/* @var $this DailyImgController */
/* @var $data DailyImg */
?>
<div class="view">
<b><?php echo CHtml::encode($data->getAttributeLabel('id_dailiy_img')); ?>:</b>
<?php echo CHtml::link(CHtml::encode($data->id_dailiy_img), array('view', 'id'=>$data->id_dailiy_img));
$category = DailyImg::model()->with('tblCategory')->findByPk($data->id_category); // ???
@jcalonso
jcalonso / MapAnnotation
Created Oct 10, 2012
Custom MKAnnotation
View MapAnnotation
#import <Foundation/Foundation.h>
#import <MapKit/MKAnnotation.h>
@interface MapAnnotation : NSObject <MKAnnotation> {
@public
CLLocationCoordinate2D coordinate;
NSString *title;
NSString *subtitle;
NSDictionary *placeData;
View rGraphproblem.js
//On ready, load graphs
$(function() {
loadGraphIndicadoresDeArtefacto();
});
//Load graphs for Indicadores of an artefacto
var loadGraphIndicadoresDeArtefacto = function(){
if($('#GraphContainer_Indicadores').length == 0)return;
You can’t perform that action at this time.