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
/** | |
* Get YouTube ID from various YouTube URL | |
* @author: takien | |
* @url: http://takien.com | |
* For PHP YouTube parser, go here http://takien.com/864 | |
*/ | |
function YouTubeGetID(url){ | |
var ID = ''; | |
url = url.replace(/(>|<)/gi,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/); |
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
<!-- | |
<form autocomplete="off"> will turn off autocomplete for the form in most browsers | |
except for username/email/password fields | |
--> | |
<form autocomplete="off"> | |
<!-- fake fields are a workaround for chrome/opera autofill getting the wrong fields --> | |
<input id="username" style="display:none" type="text" name="fakeusernameremembered"> | |
<input id="password" style="display:none" type="password" name="fakepasswordremembered"> | |
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
{ | |
"editor.fontFamily": "Fira Code", | |
"editor.fontLigatures": true, | |
"editor.fontSize": 14, | |
"editor.tabSize": 4, | |
"editor.dragAndDrop": false, | |
"editor.emptySelectionClipboard": false, | |
"editor.folding": false, // it might be useful | |
"editor.lightbulb.enabled": false, | |
"editor.mouseWheelZoom": true, |
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
const convertToSeconds = (time) => { | |
if (!Array.isArray(time.split(':'))) { | |
return false; | |
} | |
let result = | |
time.split(':').length > 2 && | |
time.split(':').map((t, i) => { | |
t = parseInt(t); |
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
const fetch = require('node-fetch'); | |
const co = require('co'); | |
/* | |
fetch('https://jsonplaceholder.typicode.com/posts/2') | |
.then(res => res.json()) | |
.then(res => console.log(title)); | |
*/ | |
// Trying to implement above function using generator and iterator |
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
// Ref: | |
// 1. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators | |
// 2. https://davidwalsh.name/es6-generators | |
// ------------------------------------ | |
function makeIterator(array) { | |
var nextIndex = 0; | |
return { |
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
// Matching a ip address version 4 | |
const IPV4_1 = /^(25[0-5]|2[0-4][0-9]|1?[0-9][0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})){3}$/; | |
const IPV4_2 = /^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$/; | |
const IPV4WithPort = /^((?:2[0-5]{2}|1\d{2}|[1-9]\d|[1-9])\.(?:(?:2[0-5]{2}|1\d{2}|[1-9]\d|\d)\.){2}(?:2[0-5]{2}|1\d{2}|[1-9]\d|\d)):(\d|[1-9]\d|[1-9]\d{2,3}|[1-5]\d{4}|6[0-4]\d{3}|654\d{2}|655[0-2]\d|6553[0-5])$/; | |
// Matching a ip address version 6 | |
const IPV6_1 = /^([0-9a-f]|:){1,4}(:([0-9a-f]{0,4})*){1,7}$/i; | |
// Matching a Username | |
const username_1 = /^[a-z0-9_-]{5,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
#Add the Ubuntu 12.04(precise) repositories | |
cat <<EOF >> /etc/apt/sources.list | |
deb http://archive.ubuntu.com/ubuntu precise main restricted universe | |
deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe | |
deb http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse | |
EOF | |
# Update the repos | |
apt-get update |
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
----- BEGIN LICENSE ----- | |
sgbteam | |
Single User License | |
EA7E-1153259 | |
8891CBB9 F1513E4F 1A3405C1 A865D53F | |
115F202E 7B91AB2D 0D2A40ED 352B269B | |
76E84F0B CD69BFC7 59F2DFEF E267328F | |
215652A3 E88F9D8F 4C38E3BA 5B2DAAE4 | |
969624E7 DC9CD4D5 717FB40C 1B9738CF | |
20B3C4F1 E917B5B3 87C38D9C ACCE7DD8 |
OlderNewer