Skip to content

Instantly share code, notes, and snippets.

View matismasters's full-sized avatar

Matis matismasters

View GitHub Profile
<?php
function devolver_ordinal($elem, $ordenados){
for($x=0;$x<count($ordenados);$x++){
$ordenado = $ordenados[$x];
if($elem == $ordenado){
return $x;
}
}
return 999999;
}
@matismasters
matismasters / gist:1079434
Created July 12, 2011 23:40
Template ejemplo en ingles
/**
* An abstract class that is
* common to several games in
* which players play against
* the others, but only one is
* playing at a given time.
*/
abstract class Game {
@matismasters
matismasters / ejercicio_motosierras.php
Created June 25, 2011 19:42
Ejercicio Motosierras
<?php
/*
* Ejercicio 1
*/
function promedio_motosierra($gasto_en_monte_forestado,$gasto_en_monte_natural,$gasto_en_monte_natural_accidentado){
return ($gasto_en_monte_forestado + $gasto_en_monte_natural + $gasto_en_monte_natural_accidentado)/3;
}
function promedio_motosierra_chica(){
return promedio_motosierra(1,1.5,2);
}
@matismasters
matismasters / gist:1029159
Created June 16, 2011 12:45
errors on rvm install
matis:~$ rvm --trace install 1.8.7
+[/home/matis/.rvm/scripts/cli] : 421 : __rvm_parse_args() $ [[ -z '' ]]
+[/home/matis/.rvm/scripts/cli] : 422 : __rvm_parse_args() $ export 'PS4=+[${BASH_SOURCE}] : ${LINENO} : ${FUNCNAME[0]:+${FUNCNAME[0]}() $ }'
+[/home/matis/.rvm/scripts/cli] : 422 : __rvm_parse_args() $ PS4='+[${BASH_SOURCE}] : ${LINENO} : ${FUNCNAME[0]:+${FUNCNAME[0]}() $ }'
+[/home/matis/.rvm/scripts/cli] : 577 : __rvm_parse_args() $ [[ -z '' ]]
+[/home/matis/.rvm/scripts/cli] : 577 : __rvm_parse_args() $ [[ -n '' ]]
+[/home/matis/.rvm/scripts/cli] : 579 : __rvm_parse_args() $ [[ 0 -eq 1 ]]
+[/home/matis/.rvm/scripts/cli] : 579 : __rvm_parse_args() $ [[ -n '' ]]
+[/home/matis/.rvm/scripts/cli] : 14 : __rvm_parse_args() $ [[ -n install ]]
+[/home/matis/.rvm/scripts/cli] : 16 : __rvm_parse_args() $ rvm_token=install
class Frecuency < ActiveRecord::Base
belongs_to :company
belongs_to :from_place, :class_name => "Place", :foreign_key => "from_place_id"
belongs_to :to_place, :class_name => "Place", :foreign_key => "to_place_id"
has_many :frecuency_lines
def name
"desde " + from_place.name + " hasta " + to_place.name + " a las " + from_time.strftime("%H:%M")
end
def short_name
class Frecuency < ActiveRecord::Base
belongs_to :company
belongs_to :from_place, :class_name => "Place", :foreign_key => "from_place_id"
belongs_to :to_place, :class_name => "Place", :foreign_key => "to_place_id"
has_many :frecuency_lines
def name
"desde " + from_place.name + " hasta " + to_place.name + " a las " + from_time.strftime("%H:%M")
end
def short_name
@matismasters
matismasters / gist:943098
Created April 26, 2011 20:45
HTML y JS para GMAPS
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=true&amp;key=ABQIAAAALo9aqudJX-CndJlG93sJ1hT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQ3t2QaEC2O7tWK6G8CATgheBuwIQ" type="text/javascript"></script>
<div id="main_wrapper">
<div id="map_canvas" style="width: 800px; height: 800px"></div>
</div>
<script type="text/javascript">
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(-31.8, -55.33333), 13);
map.setUIToDefault();
function createMarker(point, label)
{
@matismasters
matismasters / gist:902827
Created April 5, 2011 01:14
Ejemplo de leer desde el teclado 04-04-2011 CTC-ORT Colonia
public class Main {
public static void main (String[] args) {
System.out.print("Escribi algo: ");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String teclado = null;
try {
teclado = br.readLine();
} catch (IOException ioe) {
System.out.println("IO error");
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
if [[ -n "$PS1" ]] ; then
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
Miembros actuales
* Ian Gillan - Voz y Armónica
* Steve Morse - Guitarra
* Roger Glover - Bajo
* Don Airey - Teclado
* Ian Paice - Batería
Miembros anteriores
* Jon Lord - Teclado