Skip to content

Instantly share code, notes, and snippets.

View jcalonso's full-sized avatar

Juan Carlos Alonso jcalonso

View GitHub Profile
@jcalonso
jcalonso / bluehostDBBackup
Created May 1, 2014 20:47
Backup databases from bluehost
#!/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."

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:

---
# 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 December 27, 2015 06:38
Example of a Vagrant file
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 July 17, 2013 08:35
Convert from mpg or mov to flv with nice quality
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/
<script>
jQuery(function() {
jQuery('#allinone_bannerWithPlaylist_elegant').allinone_bannerWithPlaylist({
skin: 'elegant',
width: 850,
height: 400,
origThumbImgW: 90,
origThumbImgH: 90,
circleColor: "#c3a62e",
@jcalonso
jcalonso / _view.php
Created October 25, 2012 19:09
yii _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 October 10, 2012 16:54
Custom MKAnnotation
#import <Foundation/Foundation.h>
#import <MapKit/MKAnnotation.h>
@interface MapAnnotation : NSObject <MKAnnotation> {
@public
CLLocationCoordinate2D coordinate;
NSString *title;
NSString *subtitle;
NSDictionary *placeData;
@jcalonso
jcalonso / rGraphproblem.js
Created July 19, 2012 18:37
rGraph problem
//On ready, load graphs
$(function() {
loadGraphIndicadoresDeArtefacto();
});
//Load graphs for Indicadores of an artefacto
var loadGraphIndicadoresDeArtefacto = function(){
if($('#GraphContainer_Indicadores').length == 0)return;