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 regex = new RegExp(/^[+](\d{3})\)?(\d{3})(\d{5,6})$|^(\d{10,10})$/); | |
regex.test('0612345678') // true | |
regex.test('06123456789') // false | |
regex.test('+33612345678') // true | |
regex.test('+330612345678') // true | |
regex.test('+3306123456789') // false |
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
my.uuid4 = function() { | |
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, my._uuid4); | |
}; | |
// Cache callback to optimize perf | |
my._uuid4 = function(cc) { | |
var rr = Math.random() * 16 | 0; return (cc === 'x' ? rr : (rr & 0x3 | 0x8)).toString(16); | |
}; |
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 () { | |
"use strict"; | |
window.BinaryTranslate = function (number) { | |
var binaryTable = [[], []]; | |
var master = number; | |
var neighbour = nearestPowerOf2(number); | |
for (var i = neighbour; i >= 0; i--) { | |
binaryTable[0].push(Math.pow(2, i)); | |
binaryTable[1].push(master - Math.pow(2, i) >= 0 ? 1 : 0); |
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 blackOrWhite(hexcolor) { | |
var color = hexcolor.substring(1); | |
hexcolor = color.length < 5 ? color + color : color; | |
var r = parseInt(hexcolor.substr(0, 2), 16); | |
var g = parseInt(hexcolor.substr(2, 2), 16); | |
var b = parseInt(hexcolor.substr(4, 2), 16); | |
var yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; | |
return (yiq >= 125) ? '#333' : '#eee'; | |
} |
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
window.console = window.console || {}; | |
window.console.log = window.console.log || function() {}; |
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
# Example usage: | |
# <bs-carousel id="mainCarousel" | |
# bs-id="mainCarousel" | |
# has-controls="true" | |
# interval="3200" | |
# slides="[{uri: 'img/slide-1.jpg', alt: 'Slide n°1'}, {uri: 'img/slide-2.jpg', alt: 'Slide n°2'}]"> | |
# </bs-carousel> | |
'use strict' |
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> | |
<head> | |
<title>CSS Bugdroid</title> | |
<link href='http://fonts.googleapis.com/css?family=Roboto:400,100,300' rel='stylesheet' type='text/css'> | |
<style type="text/css"> | |
body { | |
padding: 40px; |
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> | |
<head> | |
<title>CSS WATCH</title> | |
<link href='http://fonts.googleapis.com/css?family=Roboto:400,100,300' rel='stylesheet' type='text/css'> | |
<style type="text/css"> | |
body { | |
background: #00bad2; |
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
'use strict'; | |
// Paper Input Directive | |
// --------------------- | |
// The AngularJS directive allowing to bind to Polymer's `<paper-input>` elements | |
// with Angular like they were standard HTML5 `<input>` elements, using the `ng-model` attribute | |
angular.module('Androguide').directive('paperInput', ['$parse', '$timeout', '$browser', function ($parse, $timeout, $browser) { | |
return { | |
restrict: 'E', |
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
export BOOTCLASSPATH /system/framework/core.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework-pac.jar:/system/framework/framework2.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/webviewchromium.jar:/system/framework/telephony-msim.jar |
NewerOlder