Skip to content

Instantly share code, notes, and snippets.

@mvark
mvark / MobilizerBookmarklet.js
Created January 8, 2015 04:54
This bookmarklet redirects the URL of the currently open web page to the Google Mobilizer web service which processes it to show just the text and optionally images within web pages. More info - http://mvark.blogspot.in/2012/04/google-mobilizer-bookmarklet-view-just.html
javascript:(function() {
location.href = 'http://www.google.com/gwt/x?noimg=1&btnGo=Go&source=wax&ie=UTF-8&oe=UTF-8&u=' + encodeURIComponent(location.href);
}
())
@mvark
mvark / WeatherTrackerGenericHandler.cs
Last active August 29, 2015 14:12
Generic Handler (.ASHX) which draws info from Yahoo Weather API & stores in Windows Azure Table. More info - http://mvark.blogspot.in/2014/01/how-to-make-automated-call-to-web-page.html
/*
This Generic Handler (.ASHX) code sample shows how to draw info from Yahoo Weather API & store it in Windows Azure Table.
The code can be configured to be triggered by an automated call to the Generic Handler (.ASHX) through Windows Azure Scheduler
*/
<%@ WebHandler Language="C#" Class="temp" %>
using System;
using System.Web;
@mvark
mvark / OAuthASPNETWebForms.cs
Created January 2, 2015 17:53
Authentication & Authorization using OAuth 2.0 Providers with ASP.NET WebForms: Code from Blaize Stewart's video tutorial "OAuth 2.0 Up and Running" (requires subscription), modified to include Microsoft's Live Connect functionality. See related blog posting - http://mvark.blogspot.in/2014/01/how-to-implement-authentication.html
/*
OAuthRedirectPage.aspx
==========================
<div>
<asp:Label ID="OAuthLabel" runat="server" Text="Label"></asp:Label>
</div>
OAuthRedirectPage.aspx.cs
==========================
*/
@mvark
mvark / AphoneticWords.html
Created December 31, 2014 08:01
Track & learn about Aphonetic Words. Demo - http://mvark.blogspot.in/p/aphonetic-words.html?m=1
<!DOCTYPE html>
<html>
<head>
<title>Aphonetic Words</title>
</head>
<body>
<style>
body { margin: 2px; font-size: 40px; }
.cell { margin: 5px; }
audio { width:45px; height:25px;}
@mvark
mvark / foodtracker.html
Last active April 3, 2017 20:29
Single Page Application (SPA) to track food expiry dates shows how to implement CRUD functionality through Azure Mobile Services HTTP OData REST calls, without writing any server-side code
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Food Tracker</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<link href='http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.1.1/fullcalendar.min.css' rel='stylesheet' />
<!DOCTYPE html>
<html>
<head>
<title>My Books</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js"></script>
<script>
//Telling Angular to use our module with ng-app
//Second parameter of module is a blank array
var myApp = angular.module("myApp", []);
$.getJSON("https://spreadsheets.google.com/feeds/list/insert-spreadsheet-key/od6/public/values?alt=json", function(data) {
for (var i = 0; i < data.feed.entry.length; i++){
//first row "bookname" & "price" columns
$('#results').append(data.feed.entry[i].gsx$bookname.$t + " Price: " + data.feed.entry[i].gsx$price.$t + "<br/>");
}
});
@mvark
mvark / TransformJSONFieldNamesForFullCalendar.js
Last active June 5, 2018 21:30
Transform JSON field names in feed to match FullCalendar jQuery plugin's Event format
$(document).ready(function() {
$('#calendar').fullCalendar({
defaultDate: '2014-11-13',
editable: true,
eventLimit: true, // allow "more" link when too many events
events: function (start, end, timezone, callback) {
$.ajax({
url: "http://example.azure-mobile.net/tables/event?$filter=eventdate gt '" + start.toISOString() + "' and eventdate lt '" + end.toISOString() + "'",
dataType: 'json',
beforeSend: setHeader,
javascript:(function() {
a = document.getElementsByTagName('a');
for (i = 0; i < a.length; i++) {
a[i].href = 'http://www.google.com/gwt/x?noimg=1&btnGo=Go&source=wax&ie=UTF-8&oe=UTF-8&u=' + encodeURIComponent(a[i].href);
a[i].style.backgroundColor = '#f0f0f0';
@mvark
mvark / StoreMinMaxTempIntoAzureTable.ps1
Created May 14, 2014 13:56
This PowerShell script to save min, max temperature fetched from Yahoo Weather API using YQL & store it in Windows Azure Table
Add-Type -Path "C:\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\v2.1\ref\Microsoft.WindowsAzure.Storage.dll"
$refs = @("C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.Services.Client.dll")
$code = @"
using System;
using System.Data.Services.Common;
[DataServiceEntity]