Skip to content

Instantly share code, notes, and snippets.

@untoldwind
untoldwind / gist:6328646
Created August 24, 2013 15:07
PHP ++ for string in Scala
override def incr: PVal = {
if (isStrongNumericPattern)
toNum.incr
else {
val tail = Array.newBuilder[Byte]
for (i <- Range(0, chars.length).reverse) {
val ch = chars(i)
if (ch == 'z') {
tail += 'a'

Keybase proof

I hereby claim:

  • I am untoldwind on github.
  • I am untoldwind (https://keybase.io/untoldwind) on keybase.
  • I have a public key ASAKNlSNIVIbxPh6nvUC-kPxODZmFRPF2wLp-mpqdtcINgo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am untoldwind on github.
  • I am untoldwind (https://keybase.io/untoldwind) on keybase.
  • I have a public key whose fingerprint is 9C4E BCCE 8909 8426 75EB 18EE A7C4 E6F4 50E4 7C3A

To claim this, I am signing this object:

@untoldwind
untoldwind / bash
Created February 2, 2019 11:37
Test geojson with javascript algorithm
npm install
node main.js
NextState got CMD: Set(14, true)
NextState got CMD: Set(14, true)
Run got CMD: Set(14, true)
NextState got CMD: Set(14, true)
NextState got CMD: Set(12, false)
NextState got CMD: Set(12, false)
NextState got CMD: Set(12, false)
NextState got CMD: Set(12, false)
Run got CMD: Set(12, false)
NextState got CMD: Set(12, false)
use { Vessel } from ksp::vessel
use { CONSOLE } from ksp::console
use { sleep } from ksp::game
use { GlobalDirection, Vec3, vec3 } from ksp::math
use { acos_deg, atan2_deg } from core::math
use { angle_to_360, angle_to_180 } from std::utils
pub fn main_flight(vessel: Vessel) -> Result<Unit, string> = {
CONSOLE.clear()
for(i in 0..100) {