Skip to content

Instantly share code, notes, and snippets.

javascript:(function()%7Bdocument.getElementById(%22txtInput%22).value%3Ddocument.getElementById(%22txtCaptcha%22).value%7D)()
@mvark
mvark / PSDownloadFiles
Last active August 29, 2015 13:57
PowerShell script to download a list of files that have a predictable number pattern
# PowerShell script to download a list of files that have a predictable number pattern
for ($i=1; $i -le 10; $i++)
{
$startTime = (Get-Date)
# Download files that have the naming format File1.txt, File2.txt etc..
(new-object System.Net.WebClient).DownloadFile("http://example/file$i.txt","C:\temp\file$i.txt")
$endTime = (Get-Date)
# Echo Time taken
"Time taken to download file$i : $(($endTime-$startTime).totalseconds) seconds"
}
Option Explicit
'References:
'http://stackoverflow.com/questions/19071173/ms-word-macro-how-to-adapt-so-it-get-data-from-my-excel-file
'http://www.mrexcel.com/forum/excel-questions/32187-convert-variant-array-string-array.html
Dim TargetList() As String
Public Sub GetWordsFromExcelAndHighlight()
Dim lngIndex As Long
@mvark
mvark / gist:7040359
Last active December 25, 2015 21:09
Sample shows how to highlight a Province within a Country (India) with Google GeoChart. Notes: http://mvark.blogspot.in/2013/10/how-to-highlight-province-within.html
<html>
<head>
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript'>
//Based on this original sample - http://jsfiddle.net/asgallant/wwDyU/1/
function drawChartIN () {
var data = new google.visualization.DataTable();
data.addColumn('string', 'INState');
@mvark
mvark / gist:5373959
Last active December 16, 2015 03:59
JS snippet shows how to get local time for a location based on its latitude and longitude using World Weather Online's Time Zone API -http://www.worldweatheronline.com/time-zone-api.aspx
function time(lat, long) {
//replace the value for the key parameter with your own
var url = "http://api.worldweatheronline.com/free/v1/tz.ashx?q=" + lat + "," + long + "&format=json&key={key}&callback=tfunc";
//reference to jQuery library is required prior to using this function
$.getScript(url, function (response) { });
}
window.tfunc = function (response) {
var time = "";
@mvark
mvark / gist:5357137
Last active December 16, 2015 01:39
Show book titles in Amazon ads by keyword
<!DOCTYPE html>
<html>
<head>
<title>Show book titles in Amazon ads by keyword</title>
</head>
<body>
<div id="amz"></div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script>
$(document).ready(function () {
@mvark
mvark / YahooWeatherViaYQL&JSONP
Last active June 29, 2016 14:44
Get Weather information for a WOEID using YQL, jQuery
<!DOCTYPE html>
<html>
<head>
<title>Weather Forecast using YQL</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
//Developer notes - http://mvark.blogspot.in/2013/03/how-to-find-weather-information-for.html
//use YQL Console to build query - http://developer.yahoo.com/yql/console/
function getWeather(woeid, unit) {