Skip to content

Instantly share code, notes, and snippets.

View jabrena's full-sized avatar

Juan Antonio Breña Moral jabrena

View GitHub Profile
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
@jabrena
jabrena / gist:b31585ee6f6b8b3deb00
Created September 19, 2015 15:00
cat /proc/cpuinfo
root@ev3dev:~/node# cat /proc/cpuinfo
processor : 0
model name : ARM926EJ-S rev 5 (v5l)
BogoMIPS : 148.88
Features : swp half thumb fastmult edsp java
CPU implementer : 0x41
CPU architecture: 5TEJ
CPU variant : 0x0
CPU part : 0x926
CPU revision : 5
@jabrena
jabrena / javascript
Created December 9, 2015 13:38
Speaking with a human
var msg = new SpeechSynthesisUtterance();
var voices = window.speechSynthesis.getVoices();
for(var i=0; i< voices.length; i++){
console.log(voices[i].name);
}
msg.voice = voices[4];
msg.lang = 'es-ES';
msg.text = "Darh vader es un tio muy malo";
window.speechSynthesis.speak(msg);
@jabrena
jabrena / example.txt
Created March 24, 2016 20:21
How to create a EV3Dev SDCard from OSX
diskutil list
diskutil unmountDisk /dev/disk2s1
sudo dd if=./rpi-ev3dev-jessie-2015-12-30.img of=/dev/rdisk2 bs=4m
sudo dd if=./rpi2-ev3dev-jessie-2015-12-30.img of=/dev/rdisk2 bs=4m
``` bash
@Autowired
private DiscoveryClient discoveryClient;
@Value("${spring.application.name}")
private String microServiceName;
@Value("${eureka.instance.leaseRenewalIntervalInSeconds}")
private int leaseInternval;
@Test
mvn archetype:generate \
-DgroupId=demo \
-DartifactId=project-name \
-DarchetypeArtifactId=maven-archetype-quickstart \
-DinteractiveMode=false
Source:
https://maven.apache.org/plugins-archives/maven-archetype-plugin-1.0-alpha-7/examples/simple.html
@jabrena
jabrena / TwentyFourtyEight
Created April 30, 2017 22:53 — forked from ayyytam/TwentyFourtyEight
2048 terminal game
// Terminal 2048
// By: Andrew Tam
// There is currently no GUI for this game and is played completely on the Terminal.
// Type in the instructions such as "up", "down", "left", "right" to move the tiles
// Type in "reset" to reset the game
import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Random;
@jabrena
jabrena / RandomGameName.java
Created April 30, 2017 23:21 — forked from trevren11/RandomGameName.java
Generate a random game name in Java
package cs340.tickettoride.shared.utils;
import java.util.Random;
public class RandomGameName {
private static String[] Beginning = {"Busy",
"Lazy",
"Careless",
"Clumsy",
@jabrena
jabrena / CatacrokerTest.java
Last active June 6, 2017 08:14
Unchecked exceptions
public class CatacrokerTest {
public static void main(String[] args){
Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
public void run() {
System.out.println("Ohh my god, the Catacroker is alive");
}
}));