Skip to content

Instantly share code, notes, and snippets.

Please refer to my gibhub https://github.com/mr-fool instead of my gist. My gist will no longer be updated
@mr-fool
mr-fool / BeanCount.js
Last active August 29, 2015 14:09
exercise 3 minimum
function countChar(string, ch) {
var counted = 0;
for (var i = 0; i < string.length; i++)
if (string.charAt(i) == ch)
counted = counted + 1;
var str1 = "The " + string + " contains " + ch + " at position " + i + ",";
var str2 = " and the total number of " + ch + " is " + counted + ".";
var result = str1.concat(str2);
return result;
}
@mr-fool
mr-fool / greeting.html
Last active August 29, 2015 14:09
javascript greeting fun
<html><body><pre><script src="greeting.js">
</script></pre></body></html>
@mr-fool
mr-fool / buzz.html
Created November 8, 2014 07:32
fizzbuzz
<html><script language="JavaScript" src="buzz.js">
</script> </html>
@mr-fool
mr-fool / triangle.html
Last active August 29, 2015 14:08
triangle
<html><script language="JavaScript" src="triangle.js">
</script> </html>
@mr-fool
mr-fool / alcohol.html
Last active August 29, 2015 14:08
Alcohol testing
<html><script language="JavaScript" src="program.js">
</script> </html>
@mr-fool
mr-fool / panzerlied.html
Last active August 29, 2015 14:08
javascript
<html><body><pre><script src="program.js"type="text/javascript" charset="utf-8">
</script></pre></body></html>
import java.net.*;
import java.util.*;
import java.io.*;
import java.awt.Image;
import java.awt.image.BufferedImage;
import javax.imageio.*;
public class HTTrack {
public static void main(String[] args) throws Exception {
//Error checking
import java.net.*;
import java.util.*;
import java.io.*;
import java.util.concurrent.*;
public class WebServer {
//to test http://localhost:portnumber/index.html
public static void main(String[] args) throws Exception {
//Creates 4 threads to handle new connections
final ExecutorService clientHandler = Executors.newFixedThreadPool(4);
@mr-fool
mr-fool / CipherText.java
Created October 15, 2014 21:22
Caesar cipher and Vigenère cipher
public class Ciphertext {
/* stores the encrypted message */
private String ctxt;
/*default constructor */
public Ciphertext()
{