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
(defmacro -> (&rest form) | |
(reduce (lambda (xs x) | |
(if (consp x) | |
(append xs x) | |
(list x xs))) | |
form)) |
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 | |
/** | |
* | |
* @package Icy Phoenix | |
* @version $Id$ | |
* @copyright (c) 2008 Icy Phoenix | |
* @license http://opensource.org/licenses/gpl-license.php GNU Public License | |
* | |
*/ |
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 | |
class XkcdParser | |
{ | |
/* @var array $last Data of the latest comic */ | |
private $last; | |
/* @var int $max Latest comic data ID */ | |
private $max; | |
public function __construct() |
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
class RecordAddress | |
FIELDS = [:number, :country, :city_zip, :city_name, :street_name, | |
:latitude, :longitude, :geocoding_failed, :place_id] | |
BOOLEANS = [:geocoding_failed] | |
ASSOCIATIONS = [:place] | |
# @param [Object] object | |
# @param [Array] ary | |
def initialize(object, col) |
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
Advanced SQL | |
<https://www.slideshare.net/MarkusWinand/modern-sql?ref=https://modern-sql.com/slides> | |
slide 3: `LATERAL` | |
slide 12: `GROUPING SETS` | |
slide 19: `WITH` | |
slide 45: `WITH RECURSIVE` | |
slide 71: `FILTER` | |
slide 75: `PARTITION BY`, `OVER` (/`OVER ORDER BY`) | |
slide 105: `WITHIN GROUP` |
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
use v6; | |
# todo parse table somehow | |
say '<meta charset="UTF-8"><style>.elem { background-color: red; }</style>'; | |
# Hard (d, h, ch, k, n, r, t) | |
# Soft (č, ř, š, ž, c, j, ď, ť, ň) | |
my @headers = << | |
'Masculine Animate (Hard)' | |
'Masculine Inanimate (Hard)' |
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
func tag(x) { | |
return func show(n) { | |
say("hello: " ~ x ~ "!"); | |
} | |
} | |
say("[ simple test ]"); | |
my node = quasi { say(""); }; | |
walk(node, [ | |
#[Q, tag("Q")], |
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
sealed trait Type {} | |
case class BuiltinType(t: String) extends Type { | |
override def toString = t | |
} | |
case class UnknownType(name: String) extends Type { | |
override def toString = name | |
} | |
case class FunctionType(from: Type, to: Type) extends Type { | |
override def toString: String = { | |
val fromS = from.toString |
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
type WithKey<T extends object, K extends string> = Record<K, string> & T; | |
class ParseObject<T extends object> { | |
public constructor(private parts: (keyof T)[]) { | |
} | |
public add<K extends string>(k: K): ParseObject<WithKey<T, K>> { | |
const parts: (keyof WithKey<T, K>)[] = [...this.parts, k]; | |
return new ParseObject<WithKey<T, K>>(parts); | |
} |
NewerOlder