Skip to content

Instantly share code, notes, and snippets.

@scriptnull
scriptnull / ListTheFiles.java
Created October 26, 2013 19:18
java snippet to list all the file names available in a folder path
import java.io.*;
public class Main {
public static void main(String[] args) throws Exception {
File folder = new File("C:/"); //folder path
File[] myf = folder.listFiles();
@scriptnull
scriptnull / basic.tcl
Created November 10, 2013 17:58
Basics of TCL scripting. UDP agent is used as example. check http://csis.bits-pilani.ac.in/faculty/murali/resources/tutorials/ns2.htm
#create ns
set ns [ new Simulator ]
#output file
set outputfile [ open out.nam w ]
$ns namtrace-all $outputfile
#trace file
set tracefile [ open out.tr w ]
$ns trace-all $tracefile
@scriptnull
scriptnull / SortArrayOneStep.java
Last active December 29, 2015 02:49
using Collection.sort(List<T> ) method as key ingredient , sorting becomes no hard job ! :)
import java.util.*;
public class SortArrayOneStep {
public static void main(String[] args) {
Integer[] arr = {5,4,3,2,1};
printArray(arr);
Arrays.sort(arr);
printArray(arr);
@scriptnull
scriptnull / GetWebPageAsString.java
Created December 8, 2013 16:35
parse a webpage into a single String . This can be used in future for manipulating json data .
package mygists;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
public class GetWebPageAsString {
@scriptnull
scriptnull / timer.html
Created February 21, 2014 16:11
My approach of writing a js timer !
<html>
<head>
<title>Timer</title>
<script type="text/javascript">
function onloadME (timer) {
window.setInterval(timerfunc,1000);
}
sec = 0 ;
min = 0;
@scriptnull
scriptnull / cookiesearch.js
Last active March 19, 2017 00:33
searching for the cookie value by giving cookie key value
//cookie Search if many cookies exist
function getMyCookie(key)
{
var cook = document.cookie.split(";");
var str ;
var vals = new Array();
for(var x = 0 ; x < cook.length ; x++ )
{
var temp = cook[x].split("=");
for(var y = 0 ; y < temp.length ; y++)
@scriptnull
scriptnull / Endless-Naruto-Download-script.js
Created April 14, 2014 14:13
No need to wait 2 mins for every download in endless-naruto.com . Open the download page , hit F12 , goto Console , copy paste the script in prompt .Find the attribute value="Naruto/Naruto Episode 88 [Endless-Naruto.com].zip" in the code and change the episode number you want to download . press enter :) Enjoy :)
document.getElementById('download_texts').innerHTML = 'Your download is ready! Click the button below to start your download.';
document.getElementById('download_input').innerHTML = '<form name="downloadForm" id="downloadForm" method="post"><input type="hidden" name="www_form_submit" value="1" /><input style="color:#111111;font-family:verdana;font-size:11px;font-size-adjust:none;font-stretch:normal;font-style:normal;font-variant:normal;font-weight:normal;line-height:normal;" type="submit" name"submit" id="submitDownload" onclick="disableDownload()" value="Download" /><input type="hidden" name="id" value="Naruto/Naruto Episode 88 [Endless-Naruto.com].zip" /> <span style="display: none;" id="enjoy"><em>Enjoy!</em></span></form>';
document.downloadForm.submit();
@scriptnull
scriptnull / Win8Layout.xaml
Created June 13, 2014 14:27
Layout, XAML , Grid , Stack Panel
<Page
x:Class="App4.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App4"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid x:Name="layoutGrid" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
@scriptnull
scriptnull / BundleConfig.cs
Last active August 29, 2015 14:03
ASP .NET MVC + BootStrap Basic installation
using System.Web;
using System.Web.Optimization;
namespace MvcBootStrapTry
{
public class BundleConfig
{
// For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
public static void RegisterBundles(BundleCollection bundles)
{
@scriptnull
scriptnull / thirugram.js
Last active September 18, 2024 06:00
spam telegram via telegram web
//spam message the chats with thirugram.js
//open up telegram web and go to the chat you want to spam
//open console ( Ctrl + Shift + J )
//execute the code
var message = ""; //spam message
var interval = 1 ; // in seconds
var count = 10 ; //number of times to send
var notifyInterval = 5 ; //notify
var i = 0 ;
var timer = setInterval(function(){