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
<html> | |
<body> | |
</body> | |
<script> | |
(function tryLoadImages(index) { | |
var img = document.createElement('img'); | |
img.src = "http://127.0.0.1:7001/" + index + ".jpg"; | |
img.onload = function() { | |
document.body.appendChild(img); |
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
[root@iZ25p1jt074Z ~]# df -m|awk 'NR==1{for(i=1;i<=NF;i++){ix[i]=$i}} (NR>1){for(i=1;i<=NF-1;i++){printf "%s:%s,",ix[i],$i} printf "%s:%s\n",ix[NF],$NF}' | |
Filesystem:/dev/xvda1,1M-blocks:20158,Used:12464,Available:6671,Use%:66%,Mounted:/ | |
Filesystem:tmpfs,1M-blocks:4096,Used:0,Available:4096,Use%:0%,Mounted:/dev/shm | |
Filesystem:/dev/xvdb1,1M-blocks:201581,Used:9433,Available:181909,Use%:5%,Mounted:/mnt | |
[root@iZ25p1jt074Z ~]# |
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
/** | |
In Java: What is the difference between: | |
Object o1= .... | |
o1.getClass().getSimpleName(); | |
o1.getClass().getName(); | |
o1.getClass().getCanonicalName(); | |
**/ | |
@Test | |
public void testNames() throws Exception { | |
//primative |
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
import org.apache.commons.httpclient.HttpClient; | |
import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; | |
import org.apache.commons.httpclient.methods.GetMethod; | |
import org.apache.commons.httpclient.params.HttpClientParams; | |
import org.apache.commons.httpclient.params.HttpConnectionManagerParams; | |
import org.openjdk.jmh.annotations.Benchmark; | |
import org.openjdk.jmh.runner.Runner; | |
import org.openjdk.jmh.runner.RunnerException; | |
import org.openjdk.jmh.runner.options.Options; | |
import org.openjdk.jmh.runner.options.OptionsBuilder; |
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
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
// more to see https://github.com/golang/go/wiki/CommonMistakes | |
func main() { | |
m := []string{"a", "b", "c", "d"} |
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
find . -type d -name "target" -maxdepth 2 | xargs rm -rf |
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
package imagexx; | |
import javax.imageio.ImageIO; | |
import java.awt.*; | |
import java.awt.image.BufferedImage; | |
import java.io.File; | |
import java.io.IOException; | |
public class RandomImage { | |
public static void main(String args[]) { |
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
import com.alibaba.fastjson.JSON; | |
import com.google.common.collect.Maps; | |
import javax.crypto.Cipher; | |
import javax.crypto.KeyGenerator; | |
import javax.crypto.SecretKey; | |
import javax.crypto.spec.SecretKeySpec; | |
import java.nio.charset.StandardCharsets; | |
import java.util.Base64; |
OlderNewer