Charles Lawrence geuis

View code-review-checklist.md
  • readability
  • maintainability
  • consistency
  • exception handling
  • simplicity
  • test coverage
  • side effect
  • reuse of existing code
  • performance
View base32decode.js
1 2 3 4 5 6 7 8 9
(function(){
"use strict";
 
//Generate dictionary
var arr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'.split(''),
dict = {};
for(var i=0, len=arr.length; i<arr.length; i++){
dict[arr[i]] = i;
}
View clever.html
1 2 3 4 5 6 7 8 9
<!doctype>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script>
 
(function(){
 
window.clever = function(user, pass){
View remote-typeahead.js
1 2 3 4 5 6 7 8 9 10
<script>
// Charles Lawrence - Feb 16, 2012. Free to use and modify. Please attribute back to @geuis if you find this useful
// Twitter Bootstrap Typeahead doesn't support remote data querying. This is an expected feature in the future. In the meantime, others have submitted patches to the core bootstrap component that allow it.
// The following will allow remote autocompletes *without* modifying any officially released core code.
// If others find ways to improve this, please share.
 
var autocomplete = $('#searchinput').typeahead()
.on('keyup', function(ev){
 
ev.stopPropagation();
View json.js
1 2 3 4 5 6 7 8 9 10
(function(){
 
var parse = JSON.parse;
 
JSON = {
 
stringify: JSON.stringify,
 
validate: function(str){
View whenthen.js
1 2 3 4 5 6 7 8 9 10
var when = function(){
if( !(this instanceof when) ) return new when(arguments); //return new instance of itself
 
var self = this; //cached so the syntax of code within the function is more readable
 
self.pending = Array.prototype.slice.call(arguments[0]); //convert arguments passed in to array
self.pending_length = self.pending.length; //cache length of the arguments array
self.results = []; //container for results of async functions
 
(function(){ // define pass() within this context so that the outer scope of self(this) is available when pass() is executed within the user's async functions
View tic-tac-toe.js
1 2 3 4 5 6 7 8 9 10
<!DOCTYPE html>
<html>
<head>
<style>
html,body{
padding:0;
margin:0;
font-family:arial;
}
.clearfix:after{
Something went wrong with that request. Please try again.