This file contains hidden or 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 this code as you please! | |
The most important bit is passing the $id as a string. | |
As long as you know the id, you can get the info you need. | |
Note: It is quite slow (at least for me)! | |
As there are more than a million people in Microsoft Virtual Academy, | |
you could pass a random id in that range and see what you get! =) | |
--> |
This file contains hidden or 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 str = "To be, or not to be, that is the question."; | |
alert( str.endsWith("question.") ); // true | |
alert( str.endsWith("to be") ); // false | |
alert( str.endsWith("to be", 19) ); // true |
This file contains hidden or 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 fun1(...theArgs) { | |
console.log(theArgs.length); | |
} | |
fun1(); // 0 | |
fun1(5); // 1 | |
fun1(5, 6, 7); // 3 |
This file contains hidden or 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
let arr = [ 3, 5, 7 ]; | |
arr.foo = "hello"; | |
for (let i in arr) { | |
console.log(i); // logs "0", "1", "2", "foo" | |
} | |
for (let i of arr) { | |
console.log(i); // logs "3", "5", "7" | |
} |
This file contains hidden or 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
section h1, article h1, aside h1 { | |
color: red; | |
} | |
/* Is the same as */ | |
:matches(section, article, aside) h1 { | |
color: red; | |
} | |
This file contains hidden or 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
a:not([rel="external"], [rel="nofollow"]) { | |
color: red; | |
} |
This file contains hidden or 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
$this->redirect('/admin/index'); //Simple | |
$urldata = $this->Session->read('manageadminuserpage'); //Redirecting to Session stored url. | |
$this->redirect($urldata); |
This file contains hidden or 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
javascript:alert("The actual URL is:\t\t" + location.protocol + "//" + location.hostname + "/" + "\nThe address URL is:\t\t" + location.href + "\n" + "\nIf the server names do not match, this may be a spoof."); |
This file contains hidden or 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
::selection {background:#ffb7b7;color: #FFF} | |
::-moz-selection {background:#ffb7b7;color:#FFF} |
This file contains hidden or 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
// jQuery: | |
$('#pass').keyup(function(e) { | |
var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g"); | |
var mediumRegex = new RegExp("^(?=.{7,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$", "g"); | |
var enoughRegex = new RegExp("(?=.{6,}).*", "g"); | |
if (false == enoughRegex.test($(this).val())) { | |
$('#passstrength').html('More Characters'); | |
} else if (strongRegex.test($(this).val())) { | |
$('#passstrength').className = 'ok'; |