Skip to content

Instantly share code, notes, and snippets.

//15.5.4.17 String.prototype.toLocaleLowerCase ( )
// This function works exactly the same as toLowerCase except that its result is intended to
// yield the correct result for the host environment’s current locale, rather
// than a locale independent result.
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (String.prototype.toLocaleUpperCase.length !== 0) {
"use strict"
var __obj = {
valueOf:function(){},
toString:void 0
};
var __split = new String(__obj).split(function(){}());
if (__split.length !== 2) {
"use strict"
var __instance = new Number(100111122133144155);
Number.prototype.split = String.prototype.split;
var __split = __instance.split(1);
var __expected = ["","00","","","","22","33","44","60"];
var __re = new RegExp(x,"g");
var __instance = String("asdf");
var __str = "1";
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
// * @description: transferring to the String objects;
//CHECK#1
try{
var s1 = new String();
s1.toString = Boolean.prototype.toString;
var v1 = s1.toString();
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError');
}
this is the same gist but after edited it
// 1: how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}
@pedrodelgallego
pedrodelgallego / pony-example.rb
Created October 27, 2010 07:30
A working example of pony and sinatra.
# You need to install these gems.
# - smtp_tls
# - pony
post "/contact-us" do
Pony.mail :to => '[email protected]',
:from => "#{params[:email]}",
:subject => "Contact SFT : #{params[:name]}",
:body=> "#{params[:body]}, --- Contact Address #{params[:email]}",
:via => :smtp,
@pedrodelgallego
pedrodelgallego / tags-counter.js
Created November 23, 2010 15:59
A map reduce function that count the tags in a gist
use gistcube
map = function() {
if (!this.tags) {
return;
}
for (index in this.tags) {
emit(this.tags[index], 1);
}
@pedrodelgallego
pedrodelgallego / kernel-revisited.scm
Created December 6, 2010 15:45
Scarecrow a lisp 1 like interpreter. It is written in Racket, a plt-scheme dialect
#lang racket/base
(require racket/match)
;; ----------------------------------- Evaluator.
(define (eval expr env)
(match expr
;; __environment__ will return the current environment/state of the interpreter.
[`__environment__ env]