Skip to content

Instantly share code, notes, and snippets.

View rkmax's full-sized avatar

Julian Reyes Escrigas rkmax

View GitHub Profile
@rkmax
rkmax / setmode.sh
Created February 21, 2012 23:25
Set mode Video
#/bin/bash
OUTPUT=VGA1
MODE="1920x1200"
xrandr --newmode $MODE 193.25 1920 2056 2256 2592 1200 1203 1209 1245 -hsync +vsync
xrandr --addmode $OUTPUT $MODE
xrandr --output OUTPUT --mode $MODE
@rkmax
rkmax / Behaviors.cs
Created August 6, 2012 21:48
Clase de Comportamientos para agregar a los controles
using System.Windows;
using System.Windows.Controls;
namespace Rkmax.Controls
{
public class Behaviors
{
public static readonly DependencyProperty SelectTextOnFocusProperty = DependencyProperty
.RegisterAttached("SelectTextOnFocus", typeof(bool), typeof(Behaviors), new FrameworkPropertyMetadata(false, GotFocus));
@rkmax
rkmax / windows.xaml
Created August 6, 2012 21:54
Uso de Behavior.cs
<Window x:Class="TypoV.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
<!--...-->
xmlns:Controls="clr-namespace:Rkmax.Controls;assembly=Rkmax">
<!--...-->
<!--Habilitamos el comportamiento en el TextBox-->
<TextBox Controls:Behaviors.SelectTextOnFocus="True"/>
<!--...-->
</Window>
@rkmax
rkmax / Rakefile
Created October 18, 2012 21:08
Assets compiling for non rails project with Sprockets
require 'sprockets'
require 'logger'
require 'fileutils'
require 'pathname'
require 'json'
ROOT = Pathname(File.dirname(__FILE__))
LOGGER = Logger.new(STDOUT)
BASE_PATH = "path/to/assets"
@rkmax
rkmax / minbase.sh
Created January 10, 2013 01:22
Genera imagenes minimas para el servidor
#!/bin/bash
SOURCE=http://es.archive.ubuntu.com/ubuntu/
BASEPATH="images"
VARIANT=minbase
ARCH=amd64
INCLUDE="language-pack-es,language-pack-es-base,ssh,vim"
if [ -z $BASEPATH ];then
echo "Defina una ruta base"
@rkmax
rkmax / deps.sh
Created May 20, 2013 20:26
Instalacion de Apche, PHP5 y Mysql en Ubuntu
#!/usr/bin/env bash
sudo apt-get install mysql-server apache2 php5 php5-cli php-apc php5-gd php5-curl php5-sqlite php5-mysql php5-xdebug php5-intl libapache2-mod-php5 git
@rkmax
rkmax / php.ini
Created May 22, 2013 14:03 — forked from bzerangue/php.ini
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@rkmax
rkmax / screen.sh
Created July 8, 2013 15:29
Arregla la mala configuración en pantallas externas con resolucion poco regulares por parte de xrandr
#!/usr/bin/env bash
# usar el comando 'gtf vres hres hfreq' para obtener la configuracion adecuada
# Ejemplo:
#
# monitor de 1920 x 1200 de 60 Hz
#
# $ gtf 1920 1200 60
# 1920x1200 @ 60.00 Hz (GTF) hsync: 74.52 kHz; pclk: 193.16 MHz
# Modeline "1920x1200_60.00" 193.16 1920 2048 2256 2592 1200 1201 1204 1242 -HSync +Vsync
@rkmax
rkmax / switch_java.jdk_template
Created July 25, 2013 14:34
Switch between Java Installations
echo export JAVA_HOME=$TMPL_PATH
var mostrar_eventos = function() {
// [{titulo: "Evento 1", descripcion: "Descripcion Evento 1"},{titulo: "Evento 2", descripcion: "Descripcion Evento 2"}]
// Cada objeto puede tener muchos campos como fecha, url, image url, etc. el resto depende de tu necesidad e imaginacion
var eventos = {{eventos}}
,template_html = '<div class="left fecha">DATE</div><div class="left"><h4><a href="/eventos">TITLE</a></h4></div><div class="descripcion" style="display: none">DESCRIPTION</div>'
,$eventosContainer = $('#ticker_eventos')
html = []
;
for (var i = eventos.length - 1; i >= 0; i--) {