Add for(value <- items)
and for(value, offset <- items)
to Sweet.js
for(x <- [1,2,3,4]) {
var a = x + 10;
print(a);
}
macro null_helper { | |
rule { ($processed ...) ($rest) } => { | |
$processed (.) ... . $rest | |
} | |
rule { ($processed ...) ($rest_head $rest ...) } => { | |
$processed (.) ... . $rest_head | |
&& null_helper ($processed ... $rest_head) ($rest ...) | |
} | |
} | |
/* | |
* Copyright (C) 2014 Square, Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
(import '[javax.script ScriptEngineManager]) | |
(let [engine (.getEngineByName (ScriptEngineManager.) "nashorn")] | |
(println (= (.eval engine "' \\r\\n' == 0") true))) |
GitHub RCE by Environment variable injection Bug Bounty writeup | |
Disclaimer: I'll keep this really short but I hope you'll get the key points. | |
GitHub blogged a while ago about some internal tool called gerve: | |
https://github.com/blog/530-how-we-made-github-fast | |
Upon git+sshing to github.com gerve basically looks up your permission | |
on the repo you want to interact with. Then it bounces you further in | |
another forced SSH session to the back end where the repo actually is. |
module Wrapping | |
def wrap(method_name, &block) | |
# Alternative implementations: either will do the trick. | |
wrap_with_prepend(method_name, &block) | |
#wrap_with_bind(method_name, &block) | |
end | |
private | |
def wrap_with_prepend(method_name) |
let let = macro { | |
rule { async $vars ... = $fname ... ($params ...); $rest ...} => { | |
$fname ... ($params ..., function (err, $vars ...) { | |
if (err) throw err; | |
$rest ... | |
}) | |
} | |
} | |
var buffer = new Buffer(1024); |
# Oona Räisänen 2013 | |
# http://windytan.com | |
# ssh-keygen -l -f ~/.ssh/id_rsa.pub | perl emoji.pl | |
@emoji = qw( 🌀 🌂 🌅 🌈 🌙 🌞 🌟 🌠 🌰 🌱 🌲 🌳 🌴 🌵 🌷 🌸 | |
🌹 🌺 🌻 🌼 🌽 🌾 🌿 🍀 🍁 🍂 🍃 🍄 🍅 🍆 🍇 🍈 | |
🍉 🍊 🍋 🍌 🍍 🍎 🍏 🍐 🍑 🍒 🍓 🍔 🍕 🍖 🍗 🍘 | |
🍜 🍝 🍞 🍟 🍠 🍡 🍢 🍣 🍤 🍥 🍦 🍧 🍨 🍩 🍪 🍫 | |
🍬 🍭 🍮 🍯 🍰 🍱 🍲 🍳 🍴 🍵 🍶 🍷 🍸 🍹 🍺 🍻 |
// enum 1 of application i18n keys | |
abstract class AppKeyi18n() | |
of title | description {} | |
object title extends AppKeyi18n() {} | |
object description extends AppKeyi18n() {} | |
// enum 2 of user i18n keys | |
abstract class UserKeyi18n() | |
of fieldText1 | fieldText2 | fieldText3 {} |
#lang typed/racket | |
;; We get exhaustive pattern matching | |
(: f ((U String Integer) -> Boolean)) | |
(define (f x) | |
(cond | |
[(string? x) (string=? x "hi")] ; covers string needs | |
[(exact-nonnegative-integer? x) (= x 7)] ; covers positive integers | |
[(even? x) (= x -8)] ; we can actually cover a subset of negative integers |