Skip to content

Instantly share code, notes, and snippets.

View Atry's full-sized avatar
😷
Wear a Mask. Save Lives.

Yang, Bo Atry

😷
Wear a Mask. Save Lives.
View GitHub Profile
#!/bin/env scala
trait 所有操作 {
protected type 操作符
protected def 创建操作符(操作: (Int, Int) => Int):操作符
final def 加 = 创建操作符(_ + _)
final def 乘 = 创建操作符(_ * _)
var path = WScript.Arguments(0);
var rev = WScript.Arguments(1);
var WshShell = new ActiveXObject("WScript.Shell");
var expectedDir = WshShell.ExpandEnvironmentStrings("%EXPECTED_DIR%");
var svnlook = WshShell.ExpandEnvironmentStrings("%SVNLOOK%");
var jenkinsUrlPrefix = WshShell.ExpandEnvironmentStrings("%JENKINS_URL_PREFIX%");
var dirsChanged = WshShell.Exec(svnlook + " dirs-changed " + path + " -r " + rev).StdOut;
while (!dirsChanged.AtEndOfStream) {
var dir = dirsChanged.ReadLine();
if (dir.match(expectedDir)) {
digraph Java有多少种方式决定Logging的去处 {
graph [ tooltip = "神马轻量级Logging框架都是骗人的" ]
log4j [ tooltip = "我很快,而且支持很多种输出目标哦" ]
slf4j -> "logback, jdk14, ..."
slf4j -> log4j
log4j -> "org.apache.log4j.ConsoleAppender"
log4j -> "org.apache.log4j.FileAppender"
log4j -> "org.apache.log4j.net.SyslogAppender"
log4j -> "org.apache.log4j.net.SocketAppender"
log4j -> "其他Appender..."
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
object Zhihu37118044 {
def printDeep(vector: IndexedSeq[_]) {
import scalaz.std.indexedSeq._
import scalaz.syntax.traverse._
((0 until 100):IxSq[Int]).foldLeftM[IxSq, Any](vector) {
case (vector: IxSq[Any], _) =>
vector
case (value: Any , _) =>
class NativeInMacro
{
@:macro public static function myMacro():haxe.macro.Expr
{
trace(MyEnum.MY_VALUE);
return macro null;
}
public static function main()
{
trace(MyEnum.MY_VALUE);
@Atry
Atry / TailCallBenchmark.scala
Created April 1, 2013 00:28
Benchmark for scala.util.control.TailCalls
import org.junit._
class TailCallBenchmark {
import scala.util.continuations._
@Test
def test() {
import scala.util.control.TailCalls._
def unwind(): Unit @cps[TailRec[Unit]] = {
class ExplicitCommonType
{
public static function main()
{
// ExplicitCommonType.hx:6: characters 71-89 : IntHash<Int> should be Hash<Int>
var iterable:Iterable<Int> = Math.random() < 0.5 ? new Hash<Int>() : new IntHash<Int>();
}
}
@Atry
Atry / README.md
Last active December 22, 2015 16:08

Gist for images

@Atry
Atry / build.hxml
Created September 14, 2013 09:34
生成textLayout的Haxe定义,并替换成2.10兼容的语法
--gen-hx-classes
-swf-lib haxelib-release/textLayout.swf
-swf no-output.swf
--no-output
--macro removeField("flashx.textLayout.conversion.BaseTextLayoutExporter","exportFlowElement",true)
--macro removeField("flashx.textLayout.conversion.BaseTextLayoutExporter","exportContainerFormattedElement",true)
--macro removeField("flashx.textLayout.conversion.BaseTextLayoutExporter","exportListItem",true)
--macro removeField("flashx.textLayout.conversion.BaseTextLayoutExporter","exportParagraphFormattedElement",true)
--macro removeField("flashx.textLayout.conversion.BaseTextLayoutExporter","exportList",true)
--macro removeField("flashx.textLayout.elements.FlowElement","abstract")