Skip to content

Instantly share code, notes, and snippets.

@Amli
Amli / gist:8934260
Created February 11, 2014 12:49
fastest repeat string n times
function repeat(str, n) {
if (n < 1) return '';
var result = '';
m = str.length
while (n > 0) {
if (n & 1) result += str;
n >>= 1;
str += str;
}
return result;
n = 1;
String("00" + n).slice(-2);
DELIMITER ;
DROP FUNCTION IF EXISTS urlencode;
DELIMITER |
CREATE FUNCTION URLENCODE(str VARCHAR(4096) CHARSET utf8) RETURNS VARCHAR(4096) CHARSET utf8
DETERMINISTIC
CONTAINS SQL
BEGIN
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<ul>
<li>1</li>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script>
for (var i = 0; i < 10; i++) {
@Amli
Amli / lorem.html
Last active April 11, 2019 08:29
example gist for ods-widgets
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit
esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident,
sunt in culpa qui officia deserunt mollit anim id est laborum.