Skip to content

Instantly share code, notes, and snippets.

View htkcodes's full-sized avatar
🎯
Focusing

BL/VCK htkcodes

🎯
Focusing
View GitHub Profile
@htkcodes
htkcodes / 0_reuse_code.js
Last active March 16, 2017 19:50
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@htkcodes
htkcodes / new_gist_file_0
Created March 16, 2017 23:49
HTML5 SHIV
<!-- 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]-->
@htkcodes
htkcodes / regex
Last active March 20, 2017 20:27
LINK REPLACE REGEX
href\s*=\s*\"[A-z0-9./!@#$%^&*()]+\" //edit all strings within the document that starts with href
@htkcodes
htkcodes / tic.html
Created November 17, 2017 13:52
TICTAC
<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>
@htkcodes
htkcodes / tic.js
Created November 17, 2017 14:04
kek
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);
}
@htkcodes
htkcodes / float.js
Created November 19, 2017 10:56
FLOAT YT
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");
@htkcodes
htkcodes / fizz.js
Last active November 22, 2017 21:28
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);
}
/*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 = {};
/*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);
/*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++) {