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
1. htpasswd -c /usr/local/apache/passwd/passwords <username1> | |
htpasswd /usr/local/apache/passwd/passwords <username12> | |
2. httpd.conf, add the following inside <Directory ....> section | |
AuthType Basic | |
AuthName "<Authentication Realm>" | |
# (Following line optional) | |
AuthBasicProvider file | |
AuthUserFile /usr/local/apache/passwd/passwords | |
#Require user <username> |
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
public int canCompleteCircuit(int[] gas, int[] cost) { | |
int[] remain = new int[gas.length]; | |
for (int i = 0; i < remain.length; i++) { | |
int j = i; | |
boolean canComp = true; | |
int capt = 0; | |
do { | |
capt += gas[j] - cost[j]; |
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
public String getPermutation(int n, int k) { | |
if (n <= 0 || k <= 0) | |
return ""; | |
// can't use array because we need remove item each time | |
// create the number array | |
int mod = 1; | |
ArrayList<Integer> nl = new ArrayList<Integer>(); | |
for (int i = 1; i <= n; i++) { | |
nl.add(i); | |
mod *= i; // calculate 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
/* setting the font-size to 16px. (or better, by using the browser’s default font-size). */ | |
input[type='text'], | |
input[type='number'], | |
textarea { | |
font-size: 16px; | |
} |
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
[].forEach.call($$("*"),function(a){ | |
a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16) | |
}) | |
// from https://gist.github.com/addyosmani/fd3999ea7fce242756b1 |
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
/* using svg as a background-image */ | |
.my-element { | |
background-image: url(image.svg); | |
} | |
.no-svg .my-element { | |
background-image: url(image.png); | |
} | |
.my-element { | |
background-image: url(fallback.png); |
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
.flex-container { | |
height: 100%; | |
display: -webkit-box; | |
display: -moz-box; | |
display: -ms-flexbox; | |
display: -webkit-flex; | |
display: flex; | |
-webkit-box-direction: normal; | |
-moz-box-direction: normal; |
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
window.onload = function() { | |
if(/iP(hone|ad)/.test(window.navigator.userAgent)) { | |
document.body.addEventListener('touchstart', function() {}, false); | |
} | |
}; | |
/* or add ontouchstart="" in element attributes */ |
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 attribute overflow="visible" to <svg> | |
/* aslo add to sprint file if using that */ |
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
run curl -L https://www.npmjs.com/install.sh | sh |