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
DELIMITER $$ | |
CREATE DEFINER=`root`@`localhost` FUNCTION `greeklish`(input text charset utf8) RETURNS text CHARSET utf8 | |
BEGIN | |
DECLARE result text charset utf8 DEFAULT ''; | |
DECLARE len INT(4) DEFAULT 0; | |
DECLARE pos INT(4) DEFAULT 1; | |
DECLARE letter VARCHAR(10) charset utf8; | |
SET input = LOWER(input); | |
SET len = CHAR_LENGTH(input); |
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
<?php | |
/** | |
* Hackish transliteration rules for greek text. | |
* @author Alexandros Sigalas <alxarch@gmail.com> | |
* @license Apache License 2.0 | |
*/ | |
class TransliterateGreek | |
{ |
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
pub mod cursor { | |
use std::ops::Deref; | |
pub struct Cursor<S> { | |
src: S, | |
cursor: Index, | |
} | |
enum Index { | |
Asc(usize), | |
Desc(usize), |
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
Verifying my Blockstack ID is secured with the address 1FYD3TKnB9gFSpwtRLzmFgPYjRkvJteBfw https://explorer.blockstack.org/address/1FYD3TKnB9gFSpwtRLzmFgPYjRkvJteBfw |
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
// OnceNoError is like sync.Once but retries until no error occured. | |
type OnceNoError struct { | |
mu sync.Mutex | |
done uint32 | |
} | |
func (once *OnceNoError) Do(fn func() error) (err error) { | |
if atomic.LoadUint32(&once.done) == 1 { | |
return | |
} |
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 python | |
import sys | |
[sys.stdout.write(line.decode('unicode_escape')) for line in sys.stdin] |
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/sh | |
if [ -z "$(which redis-cli)" ]; then | |
apk add --no-cache redis | |
fi | |
MONITOR_URL=$1 | |
EVENT_NAME=${EVENT_NAME:=status} | |
REDIS_HOST=${REDIS_HOST:=localhost} | |
EVENT_QUEUE=${EVENT_QUEUE:=monitoring:events} |
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
var db = require('Sequelize')(); | |
db.dialect.supports.schemas = true; | |
var Q = db.dialect.QueryGenerator; | |
module.exports = function (req, res, next) { | |
var schema = req.schema; | |
var quoteTable = (param, as) { | |
if ('string' == param) { | |
param = { tableName: param }; | |
} | |
param.schema = schema; |
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
module namespace num = "http://thinking.gr/modules/numerals"; | |
declare variable $num:valid-greek := "^[ρστυφχψωϠϡͲͳ]?[ικλμνξοπϞϟ]?[αβγδεζηθςϜϝ]$"; | |
declare function num:to-greek($i as xs:integer) as xs:string | |
{ | |
if($i gt 0 and $i lt 1000) then | |
let $x100 := op:numeric-integer-divide($i, 100) | |
let $x10 := op:numeric-integer-divide($i mod 100, 10) | |
let $x1 := $i mod 10 |
NewerOlder