Message block which provides a basic "sms-message" functionality via HTML.
- If message length < 1, a button will be disabled.
- Displaying a message status (length/maxLength).
- Dynamic message status changing.
See jsfiddle
// Go to the next item. | |
function nextIndex(index, arr){ | |
var item = null; | |
var minI = 0; | |
var i = index; | |
while (i < arr.length) { | |
i++; | |
if (i == arr.length) { i = minI; } | |
if (arr[i].id && arr[i].val) { item = arr[i]; break;} | |
} |
function getAllUrlParams(url) { | |
// get query string from url (optional) or window | |
var queryString = url ? url.split('?')[1] : window.location.search.slice(1); | |
// we'll store the parameters here | |
var obj = {}; | |
// if query string exists | |
if (queryString) { |
// | |
// ES5 IMPLEMENTATION | |
// | |
function applyFilter(binary){ | |
return function(a,b){ | |
return binary(a,b); | |
} | |
} | |
function add(a,b){ return a + b; } | |
function mult(a,b){ return a * b } |
#!/usr/bin/env python | |
class Fruit: | |
def __init__(self): | |
self.__state__ = False | |
def isEaten(self): | |
return self.__state__ |
/* | |
* @param num {number} - required digit | |
* @param arr {array} - input set of digits | |
* @returns {number} - closest item | |
*/ | |
function closest (num, arr) { | |
try { | |
if(isNaN(num)){ | |
throw new Error("The 1st argument is not a number."); |
using System; | |
using System.Linq; | |
using System.Collections.Generic; | |
namespace Program { | |
public static void Man(string[] args) { | |
Random rnd = new Random(); | |
Dictionary<string, long> dic = new Dictionary<string, long>() { }; |
Message block which provides a basic "sms-message" functionality via HTML.
See jsfiddle
Used languages: JavaScript, C#.
Number: 93.
Simple implementation Angular's ng-repeat behaviour.
jsfiddle#1 - just elements repeating
jsfiddle#2 - repeating with hardcodded click
jsfiddle#3 - repeating with click
var users = [ | |
{"FullName": "User one", "Email": "[email protected]", "Phone": "1234567890", "Id": 1}, | |
{"FullName": "User two", "Email": "[email protected]", "Phone": "1234567890", "Id": 2}, | |
{"FullName": "User three", "Email": "[email protected]", "Phone": "1234567890", "Id": 15}, | |
{"FullName": "User four", "Email": "[email protected]", "Phone": "1234567890", "Id": 14}, | |
{"FullName": "User five", "Email": "[email protected]", "Phone": "1234567890", "Id": 12}, | |
{"FullName": "User six", "Email": "[email protected]", "Phone": "1234567890", "Id": 8}, | |
{"FullName": "User seven", "Email": "[email protected]", "Phone": "1234567890", "Id": 16}, | |
{"FullName": "User eight", "Email": "[email protected]", "Phone": "1234567890", "Id": 9}, | |
{"FullName": "User nine", "Email": "[email protected]", "Phone": "1234567890", "Id": 25}, |