Skip to content

Instantly share code, notes, and snippets.

@cgwyllie
cgwyllie / Kumulos+MD5.h
Last active November 19, 2016 16:22
Kumulos Objective-C Bindings Compatibility Extensions
//
// Kumulos+MD5.h
//
@import KumulosSDK;
@interface Kumulos (MD5)
- (NSString*) md5:(NSString*) inString;
@cgwyllie
cgwyllie / scandir.js
Created January 16, 2015 00:12
Emscripten scandir implementation
// NOTE implementation created in March 2013, may no longer work with Emscripten master
// http://pubs.opengroup.org/onlinepubs/9699919799/functions/scandir.html
// filter and compar are currently ignored
_scandir = function (dirp, namelist, filter, compar) {
var dirPath = Pointer_stringify(dirp);
var path = FS.analyzePath(dirPath);
var files = [];
if (path.error == 0) {
@cgwyllie
cgwyllie / test.php
Created September 11, 2013 09:11
Simple failing case for php-spidermonkey mozjs17 port
<?php
$js = new JSContext();
$js->registerFunction('var_dump', 'var_dump');
$window = (object) [
'foo' => function () {
print 'foo';
}
];
(function() {
Backbone.Model.prototype._save = Backbone.Model.prototype.save;
Backbone.Model.prototype.save = function (attrs, options) {
var that = this;
if (!options) {
options = {};
}
if (this.savingNewRecord) {
// store or replace last PUT request with the latest version, we can safely replace old PUT requests with new ones
// but if there are callbacks from a previous PUT request, we need to make sure they are all called as well