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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> | |
<!-- WARNING: Respond.js doesn't work if you view the page via file:// --> | |
<!--[if lt IE 9]> | |
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> | |
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> | |
<![endif]--> |
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
href\s*=\s*\"[A-z0-9./!@#$%^&*()]+\" //edit all strings within the document that starts with href |
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
<html> | |
<head> | |
<title> | |
Tic-Tac Toe</title> | |
<link rel="stylesheet" href="main.css" type="text/css"> | |
<link href="https://fonts.googleapis.com/css?family=Kavoon" rel="stylesheet"> | |
<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet"> | |
</head> | |
<body> |
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 f(a, b) { | |
this.s = a; | |
this.o = b; | |
this.value = this.v = null; | |
} | |
f.prototype = {constructor:f}; | |
function h(a, b) { | |
a.value = b; | |
a.v && a.v.text(a.value); | |
} |
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 iniFloater() { | |
var player, plrApi, out_of_sight, isFloater, isFScreen, floaterUI, settings_open; | |
player = document.getElementById("movie_player"); | |
plrApi = document.getElementById("player-api").getBoundingClientRect(); | |
settings_open = document.getElementById("P-settings"); | |
if (player) { | |
out_of_sight = plrApi.bottom < ((plrApi.height / 2) + 50); | |
isFloater = document.documentElement.classList.contains("floater"); | |
isFScreen = document.querySelector(".ytp-fullscreen"); | |
floaterUI = document.getElementById("part_floaterui"); |
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
fizz(500); | |
function fizz(num) { | |
for(let z=1; z<num;z++) | |
{ | |
if(z%15 ===0) console.log('FizzBuzz'); | |
else if (z%3 ===0) console.log('Fizz'); | |
else if(z%5 ===0) console.log('Buzz'); | |
else | |
console.log(z); | |
} |
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
/*jshint esversion: 6 */ | |
/* | |
Create an algorithm to test if a note can be formed | |
from a magazine text | |
*/ | |
//Returns true or false if note can be formed from magazine text | |
function ransomeNote(noteText, magazineText) { | |
let magazineTextArr = magazineText.split(" "), noteTextArr = noteText.split(" "), b = {}; |
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
/*jshint esversion: 6 */ | |
/* | |
Caesar Cipher is one of the earliest and simplest encryption technique. To encrypt a message, we shift the alphabets of the message by a fixed position or key. | |
For example, if message is ABC , and we shift each character by 3 characters, we will get DEF. Here key is 3. | |
*/ | |
caesarCipher('Javascript',1); |
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
/*jshint esversion: 6 */ | |
/* | |
Write a algorithm that prints the numbers from 1 to n. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz” | |
*/ | |
fizz(10); | |
function fizz(number) { | |
for (let z = 1; z < number; z++) { |
OlderNewer