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
(^\/\/.*)|(\s+\/\/.*)|((\/\*)(.|\n)+?(\*\/)) |
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
(?:https?:\/\/)?(?:www\.)?youtu(?:.be\/|be\.com\/watch\?v=|be\.com\/v\/)(.{8,}) |
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
// ---- | |
// Sass (v3.3.4) | |
// Compass (v1.0.0.alpha.18) | |
// ---- | |
// Capitalize string | |
// -------------------------------------------------------------------------------- | |
// @param [string] $string | |
// -------------------------------------------------------------------------------- | |
// @return [string] |
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 closestNumber = (array, num) => { | |
const i = 0; | |
let minDiff = 1000; | |
let ans; | |
for (i in array){ | |
const m = Math.abs(num - array[i]); | |
if (m < minDiff) { | |
minDiff = m; |
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 ua = navigator.userAgent, | |
doc = document, | |
docEl = doc.documentElement; | |
/** | |
* Detect mobile "font-face" support | |
* | |
* Doesn't check support on desktop browsers | |
* so you should use Modernizr in combination with this | |
* UA detection to get the most out of it. |
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
/** | |
* Detect "touch" support and act accordingly. | |
* Adds `touch` class and assumes there is `no-touch` class added in <html> element. | |
*/ | |
let hasTouch = false; | |
const docEl = document.documentElement; | |
if (('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch || navigator.msMaxTouchPoints) { | |
docEl.className = docEl.className.replace(/(^|\s)no-touch(\s|$)/, ' touch '); | |
hasTouch = 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
# Curl | |
**Test origin to a target**: | |
`curl -i -H "Origin: http://origindomain.com" targetdomain.com` | |
# SSH | |
**Show all added keys**: | |
`ssh-add -l` |
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
**Ubuntu version**: | |
`lsb_release -a` | |
**Amount of ram**: | |
`lshw -C memory` | |
**Switch to superuser**: | |
`sudo su` | |
**Show linux headers**: |
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
# Install Composer to Jelastic etc. | |
If the environment is new, you'll need composer. | |
1. `cd /var/www/webroot` | |
2. `curl -sS https://getcomposer.org/installer | php` | |
3. `mkdir ~/bin` | |
4. `mv ./composer.phar ~/bin/composer` | |
After installing, you can add composer to your PATH. |
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
**Update latest settings and install apache w/ MySQL**: | |
``` | |
apt-get update | |
apt-get install apache2 | |
apt-get install php5-mysql | |
apt-get install php5 | |
apt-get install php5-gd # (if gd needed) | |
apt-get install mysql-server | |
``` |
OlderNewer