Skip to content

Instantly share code, notes, and snippets.

View kishaningithub's full-sized avatar

Kishan B kishaningithub

View GitHub Profile
@kishaningithub
kishaningithub / Java std IO
Created February 16, 2015 10:55
Performing java std io
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String strLine = in.readLine();
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@kishaningithub
kishaningithub / annoyer.html
Last active August 29, 2015 14:12
annoyer.html
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body style="background-color:black">
<div id="junkWriter" style="color:green">2 5 6 8 7 2 8 5 3 3 2 1 8 8 1 0 1 7 2 3 4 2 5 3 4 3 5 2 5 0 7 2 5 7 8 2 0 0 2 4 6 8 2 0 7 6 8 7 8 8 7 6 1 1 6 8 2 7 1 1 3 4 8 5 0 0 4 4 6 4 3 8 0 7 6 1 5 5 0 6 6 3 0 4 8 2 1 6 0 2 6 1 2 4 1 0 0 1 4 0 7 0 4 6 4 3 5 7 1 7 2 6 3 7 8 3 3 5 4 1 2 3 6 2 5 6 8 5 2 2 0 8 8 8 4 2 4 6 3 7 4 2 2 1 0 3 1 7 8 2 5 5 3 0 5 2 8 3 7 1 1 4 0 0 0 1 8 2 4 4 2 1 4 0 8 0 2 7 7 8 6 5 0 7 8 8 8 7 5 0 4 1 7 8 0 0 4 1 1 2 3 0 5 2 8 0 6 5 5 5 2 4 3 0 3 1 3 4 4 4 5 4 0 4 4 6 3 6 5 2 8 2 1 8 8 2 2 3 8 4 1 5 4 1 1 1 7 6 1 2 0 7 8 6 4 0 5 3 8 5 2 4 3 8 1 0 1 2 6 6 4 1 0 2 6 1 6 5 6 6 6 8 4 1 2 0 0 4 4 6 8 5 5 1 2 4 8 1 2 2 2 6 8 0 5 2 0 0 6 4 6 1 7 3 2 1 6 8 6 8 4 5 6 7 6 0 0 2 0 3 8 7 2 7 0 6 6 1 0 0 0 0 6 0 6 6 3 4 3 8 4 4 4 0 3 8 7 3 6 8 1 8 5 1 8 3 6 3 4 5 4 2 5 2 4 5 4 7 1 5 7 8 5 2 3 5 5 6 4 7 5 4 0 5 7 2 4 1 8 2 7 4 5 0 7 7 3 5 3 5 7 2 1 1 5 8 7 5 6 0 6 4 7 1 4 8 8 1 3 0 8
@kishaningithub
kishaningithub / GooodBoy.html
Last active August 29, 2015 14:12
GooodBoy.html
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body style="background-color:black">
<div id="junkWriter" style="color:green">
</div>
<script>
(function(){
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
@kishaningithub
kishaningithub / gist:715dd5498364c07289e9
Created December 30, 2014 09:22
gmailRaider appscript
function gmailRaider() {
for(var i=0;MailApp.getRemainingDailyQuota()>0;i++){
MailApp.sendEmail('<<Target EmailId>>', 'yes'+(i+1) , 'Stinkie');
}
}
@kishaningithub
kishaningithub / jsNice
Created November 19, 2014 18:43
Nice Links on javascript
http://stackoverflow.com/questions/359494/does-it-matter-which-equals-operator-vs-i-use-in-javascript-comparisons

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@kishaningithub
kishaningithub / gist:7273be2ec5deae0c4f47
Last active August 29, 2015 14:06
Java System Stack Limit Test
/* max sys stack entries
My i7 mac - 11909
My office i5 dell pc - 8437
*/
public class StackOverFlowThreshold
{
private static int noOfCalls=0;
public static void main(String[] args)
{
#include <stdio.h>
main()
{
printf("%d",pow_recurse(3,300));
}
int pow_recurse(int base,int power)
{
int temp;
@kishaningithub
kishaningithub / Prime No
Created March 18, 2014 09:44
Pgm to find prime nos
#include <stdio.h>
#include <string.h>
#include <math.h>
main()
{
int primes[1000];
primes[0]=2;
primes[1]=3;
int primes_len=2,is_prime,i,j,i_sqrt;