This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Get percentage loaded from image</title> | |
<script type="text/javascript"> | |
Image.prototype.onChangeSize; | |
Image.prototype.load = function(url){ | |
var _this = this, | |
req = ((XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(!String.startsWith) { | |
String.prototype.startsWith = function startsWith(start) { | |
var index = start.length; | |
var subStr = this.substr(0, index); | |
return subStr === start; | |
}; | |
} | |
if(!String.endsWith) { | |
String.prototype.endsWith = function endsWith(end) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Jetty = require('jetty'), | |
cls = require('cli-color'), | |
jetty = new Jetty(process.stdout); | |
jetty.clear(); | |
var console_color = [ | |
{range: 0, limit: 9, color: 196}, | |
{range: 10, limit: 19, color: 202}, | |
{range: 20, limit: 29, color: 214}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function memorySizeOf(obj) { | |
var bytes = 0; | |
function sizeOf(obj) { | |
if (obj !== null && obj !== undefined) { | |
switch (typeof obj) { | |
case 'number': | |
bytes += 8; | |
break; | |
case 'string': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define( | |
[], | |
function () { | |
var instance; | |
var Class = function () {}; | |
return function getInstance() { | |
if(!instance) { | |
instance = new Class(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
server_pass=true | |
client_pass=true | |
echo "\nValidating JavaScript:\n" | |
SERVER_FILES=$(jshint --config ./config/.jshintrc-server --exclude node_modules,public,client,bower_components .) | |
CLIENT_FILES=$(jshint --config ./config/.jshintrc-client client) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Stack | |
{ | |
public: | |
Stack(int); | |
~Stack(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
template <typename T, int N> | |
int binarySearch(T(&array)[N], int toSearch) { | |
int start = 0; | |
int length = N - 1; | |
while (start <= length) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<cstdlib> | |
#include<string> | |
#include<cstdio> | |
using namespace std; | |
const int TABLE_SIZE = 128; | |
class HashEntry | |
{ | |
public: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isValidDocument(document) { | |
if (!document) return false; | |
if (document.includes('-')) { | |
document = document.replace(/-/g, ''); | |
} | |
let verificador = 0; | |
let digito = 0; | |
let digitoVerificador = 0; | |
let digitoImpar = 0; | |
let sumaPar = 0; |
OlderNewer