Skip to content

Instantly share code, notes, and snippets.

View chochos's full-sized avatar
💩
(╯°□°)╯︵ ┻━┻

Enrique Zamudio chochos

💩
(╯°□°)╯︵ ┻━┻
View GitHub Profile
@chochos
chochos / gist:1109589
Created July 27, 2011 15:15
Canal jAlarms para Growl
<bean class="com.solab.alarms.channels.CommandLineChannel">
<property name="commandWithArgs"><list>
<value>/usr/local/bin/growlnotify</value>
<value>-m</value>
<value>${alarm}</value>
<value>Alarma del motor</value>
</list></property>
<property name="minResendInterval" value="5000" />
</bean>
@chochos
chochos / build.gradle
Created October 14, 2011 23:53
Gradle script for Finagle projects
apply plugin:'scala'
repositories {
mavenLocal()
mavenCentral()
//This repo is for the Finagle jars
mavenRepo urls:'http://maven.twttr.com'
}
dependencies {
@chochos
chochos / NSFW.scala
Created January 12, 2012 18:25
NSFW Scala graffiti
object D extends App {
implicit def =====(x:Int)={
print(x)
print("=====D")
D
}
def apply(f1: => Unit)(f2: => Unit)={
f1
f2
println()
@chochos
chochos / lcd.ceylon
Created March 22, 2012 06:54
LCD in Ceylon
class Digito(String partes) {
shared String parte(Integer idx) {
if (exists p=partes[idx]) {
if (p==`_`) {
return " _ ";
} else if (p==` `) {
return " ";
} else {
return "| ";
}
@chochos
chochos / MagicalLand.java
Created February 21, 2013 16:36
Monopattable Unicorns
public class MagicalLand {
public static void main(String[] args) {
for (int i = 0; i < (Math.random() * 500) + 2; i++) {
if (Unicorn.pat()) {
System.out.println("UNICORN #1: PAT THIS UNICORN ONCE");
}
}
for (int i = 0; i < (Math.random() * 500) + 2; i++) {
if (Unicorn.pat()) {
@chochos
chochos / GameOfLife.ceylon
Last active November 29, 2020 08:37
The Game of Life, implemented in Ceylon, for display in the Ceylon web IDE. You can run this on https://trybeta-ceylon.rhcloud.com/
class Cell(index) {
doc "The index of the Cell inside its Matrix."
shared Integer index;
doc "The current state of the Cell."
shared variable Boolean state = false;
doc "The next state of the Cell."
variable Boolean ns = false;
shared Boolean nextState { return ns; }
assign nextState {
@chochos
chochos / gist:7603754
Created November 22, 2013 17:29
Inner class bug in Groovy
class Parent {
String name
}
class External extends Parent {
String outer
Internal inner(String p) {
new Internal(inner:p)
}
class Internal {
String inner
@chochos
chochos / jvm.sh
Created March 19, 2014 16:40
A simple shell to switch between JDK 7 and 8 on Mac OS X. Save to `jvm`, chmod 700, put in your $PATH then `source jvm 8` (or 7)
#!/bin/bash
if [ "$1" == "7" ]; then
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
elif [ "$1" == "8" ]; then
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home
else
echo Just pass 7 or 8 dude
fi
@chochos
chochos / simple.html
Created August 27, 2014 15:34
Very simple ceylon-js page with require-jquery
<html>
<head>
<title>simple ceylon-js test</title>
<script type="text/javascript" src="../ceylon-web-ide-backend/src/main/webapp/scripts/require-jquery.js" data-main="simple.js"></script>
</head>
<body>
</body></html>
@chochos
chochos / simple.html
Last active August 29, 2015 14:05
Example of entry point to use ceylon-js
<html>
<head>
<title>simple ceylon-jsjs test</title>
<script type="text/javascript" src="../ceylon-web-ide-backend/src/main/webapp/scripts/require.js" data-main="simple.js"></script>
</head>
<body>
</body></html>