Skip to content

Instantly share code, notes, and snippets.

impl @ZipFile: io::Reader {
pub fn read(bytes: &[mut u8], len: uint) -> uint {
io::println(fmt!("Calling read for %? bytes", len));
if !self.open {
0
} else {
do vec::as_mut_buf(bytes) |buf_p, buf_len| {
assert buf_len >= len;
let count = zip_fread(self.file, buf_p as *c_void, len as uint64_t);
if count == EOF as int64_t { self.open = false; }
impl @ZipFile: io::Reader {
pub fn read(bytes: &[mut u8], len: uint) -> uint {
io::println(fmt!("Calling read for %? bytes", len));
if !self.open {
0
} else {
do vec::as_mut_buf(bytes) |buf_p, buf_len| {
assert buf_len >= len;
let count = zip_fread(self.file, buf_p as *c_void, len as uint64_t);
if count == EOF as int64_t { self.open = false; }
extern mod std;
use libc::*;
pub mod api {
/* flags for zip_open */
pub const ZIP_CREATE : c_int = 1;
pub const ZIP_EXCL : c_int = 2;
pub const ZIP_CHECKCONS : c_int = 4;

Introduction

What is Pratphall?

Pratphall is a new language targetting PHP. Well, actually it is just TypeScript which is a typed superset of JavaScript. Pratphall cross-compiles TypeScript code to PHP code which means the developer can leverage lots of existing code, patterns, and IDE support that is already built into TypeScript.

Goals

What we're trying to do:

Introduction

What is Pratphall?

Pratphall is a new language targetting PHP. Well, actually it is just TypeScript which is a typed superset of JavaScript. Pratphall cross-compiles TypeScript code to PHP code which means the developer can leverage lots of existing code, patterns, and IDE support that is already built into TypeScript.

Goals

What we're trying to do:

@cretz
cretz / gist:4403246
Last active December 10, 2015 07:48
<!DOCTYPE html>
<html>
<head lang="en">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pratphall</title>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet">
<link href="pratphall.css" rel="stylesheet">
</head>
<body data-spy="scroll" data-target=".top-level-nav">
<div class="container">
@cretz
cretz / common.ts
Last active December 12, 2015 01:48
//string length test
var hey = 'hey';
var_dump(hey.length);
module SoftLayer {
module Zookeeper {
class Acl {
static openAclUnsafe = new Acl(Zookeeper.PERM_ALL);
constructor(public permissions) { }
}
}
class Zookeeper {
module SoftLayer {
module Zookeeper {
class Acl {
static openAclUnsafe = new Acl(123);
constructor(public permissions: number) { }
}
}
}

Keybase proof

I hereby claim:

  • I am cretz on github.
  • I am cretz (https://keybase.io/cretz) on keybase.
  • I have a public key whose fingerprint is D6AB 8311 C672 88A0 D638 C002 4454 B3DA C2BE B8C4

To claim this, I am signing this object: