This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Length { | |
int getLength(); | |
} | |
class CommentStruct { | |
protected String author; | |
protected String content; | |
} | |
public class Comment extends CommentStruct implements Length{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Genera una nueva lista como `lista`, pero los valores asociados a | |
# `:id` de cada elemento valen lo miso que su posición en la lista. | |
# | |
# Ejemplo: | |
# | |
# reindexar([{id: nil, val: :x}, {id: nil, val: :y}]) | |
# # genera | |
# [{id: 0, val: :x}, {id: 1, val: :y}] | |
# | |
# @param lista [[Object]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns jgomo3.playground.blackbox.bb3) | |
(def tdc-long 16) | |
(def tdc-ocult 13) | |
(def tdc-most (- tdc-long tdc-ocult)) | |
(defn tdc-req? [n] | |
"String -> Boolean | |
Condición para procesar `n` como tarjeta de crédito" | |
(= (count n) tdc-long)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns jgomo3.playground.blackbox.bb2) | |
;; v1: No considera el hecho de que hay combinaciones de Rubik imposibles. | |
(def v1-rubik-base (flatten (map (partial repeat 9) (range 6)))) | |
(defn v1-generar-cubo-rubik-aleatorio! | |
"Genera un arreglo de 54 casillas con 9 números repetidos cada uno 6 | |
veces en un orden cualquiera" | |
[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns jgomo3.playground.blackbox.bb1 | |
(:require [java-time :as jt])) | |
(def bb-date-format "y-M-d") | |
(defn en-año | |
"Determina si `fecha` está en el año `año`." | |
[año fecha] | |
(= (jt/as fecha :year) año)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env | |
# mllp-constantly-server port response | |
# | |
# Listen on port `port` for messages and response always the same content: | |
# whatever is in the `response` file. | |
# Supposing mllp-wrap to excecute the `mllp-wrap.sh` script in this gist. | |
while true; do mllp-wrap $2; done | nc -k -l $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PRJ=$1 | |
BCKP="backups/$PRJ_`date +%Y-%m-%d_%H:%M`" | |
install -d $BCKP | |
rsync -av --progress $PRJ/ $BCKP/phmsrails --exclude log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=AutoSSH reverse tunnel for allowing access here | |
After=network.target | |
[Service] | |
Environment="AUTOSSH_GATETIME=0" | |
ExecStart=/usr/bin/autossh -i /root/us-east-1.pem -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -NR 0.0.0.0:2000:localhost:22 [email protected] | |
[Install] | |
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns playground.stream-edn | |
(:require [clojure.java.io :as io] | |
[clojure.edn :as edn]) | |
(:gen-class)) | |
(defn edn-reader [rsrc-name] | |
(->> rsrc-name | |
io/resource | |
io/reader | |
(#(java.io.PushbackReader. %)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
To test that the Linux framebuffer is set up correctly, and that the device permissions | |
are correct, use the program below which opens the frame buffer and draws a gradient- | |
filled red square: | |
retrieved from: | |
Testing the Linux Framebuffer for Qtopia Core (qt4-x11-4.2.2) | |
http://cep.xor.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html | |
*/ |
NewerOlder