This file contains hidden or 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
# Tohles mi poslal | |
$r = $db->query($s); | |
while($res = $r->fetchObject()){ | |
include($res->script_path); | |
} | |
$r = $db->query($s); | |
function tabber($path, $res) { | |
if(file_exists($path)) { |
This file contains hidden or 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
michal@michal-P5Q-PRO:~/Plocha$ cat test.mirah | |
class Test | |
def getParam(param:String):String | |
param | |
end | |
macro def [](key) | |
quote { getParam(`key`) } | |
end |
This file contains hidden or 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
import java.util.* | |
import java.lang.reflect.* | |
import java.lang.reflect.Method | |
class ArrayHelper | |
def self.inspect(l:List) | |
unless l | |
"List(nil)" | |
else |
This file contains hidden or 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
/* | |
Wrapper around AppEngine API that can send a simple email. | |
Email.from(customer.email, customer.name). | |
to('michal.hantl@gmail.com', 'Michal Hantl'). | |
subject('UseDriven feedback'). | |
body('Your message'). | |
send | |
*/ |
This file contains hidden or 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
/* | |
Featuring sexy import & export, VERY unclean code, first iteration | |
*/ | |
import ext.* | |
import models.* | |
import java.util.regex.* | |
import java.util.ArrayList | |
import java.util.HashMap | |
import domain.* |
This file contains hidden or 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
# Put this at the end of your app.yaml | |
# My class's package is ext, you might try putting above files into your models or somewhere | |
- url: /* | |
filter: ext.ShowExceptionFilter |
This file contains hidden or 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
# application controller should override this one | |
def private_exception(ex:Throwable):void | |
puts ShowException.plain(ex) | |
out = ShowException.new.pretty(request, ex) | |
#puts out | |
params.content = out | |
end | |
def public_exception(ex:Throwable):void | |
puts ShowException.plain(ex) |
This file contains hidden or 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
<h1>Hello</h1> | |
<pre> | |
<?php | |
$measuring = new UseDrivenMeasuring(); | |
echo $measuring->cipher('hello world!'); | |
class UseDrivenMeasuring { |
This file contains hidden or 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
/* | |
This class uses AES 128 in CBC mode, I've torned this from my own code so it not a drop-in solution at all, | |
but you can see the steps for working with AES in mirah. | |
It is used to encrypt JSON messages with trailing SHA1 before '{' to make it more secure | |
(if you add ranadom data like timestamp to your message, | |
it will generate different ciphered message every time). | |
*/ | |
import com.google.appengine.ext.mirah.db.* |
This file contains hidden or 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
import javax.servlet.http.* | |
import javax.servlet.* | |
import java.lang.reflect.* | |
import java.util.* | |
import middleware.* | |
class EntryPoint < HttpServlet | |
def initialize |