Skip to content

Instantly share code, notes, and snippets.

View amolk's full-sized avatar

Amol Kelkar amolk

  • Got It, inc
  • Redmond, WA
View GitHub Profile
@amolk
amolk / gdata_batch_request.rb
Created November 5, 2012 22:04
GData batch requests
# NOTE: This call will result in an error. Apparently queries cannot be batched (https://groups.google.com/forum/?fromgroups=#!searchin/youtube-api-gdata/Invalid$20entry$20Id$2FUri/youtube-api-gdata/2QQSXx8-c4A/UAJ9NhMzgvMJ).
# The surrounding xml container for batch requests is valid and is saved here as an example.
require 'builder'
xml = Builder::XmlMarkup.new; false
xml.instruct! :xml, :encoding => "UTF-8"
ns = {"xmlns"=>"http://www.w3.org/2005/Atom", "xmlns:openSearch"=>"http://a9.com/-/spec/opensearchrss/1.0/", "xmlns:g"=>"http://base.google.com/ns/1.0", "xmlns:batch"=>"http://schemas.google.com/gdata/batch"}
xml.feed(ns) do |feed|
feed.title "Channel stats query"
@amolk
amolk / app_server_node_ubuntu.sh
Created May 10, 2012 02:10
First app server server for node.js on Ubuntu 10.x
echo "Set up folders" && \
sudo mkdir /var/www && \
sudo mkdir /var/www/testapp && \
sudo chown ubuntu /var/www/testapp && \
cd /var/www/testapp && \
echo "Create hello world application" && \
echo 'require("http").createServer(function(request, response) {
response.end("Hello World");
}).listen(3000);
@amolk
amolk / install_node_ubuntu.sh
Created May 10, 2012 01:07
Install latest node.js on Ubuntu 10.x
echo "Install basics" && \
sudo apt-get install build-essential libssl-dev curl git-core && \
echo "Install node.js" && \
bash < <(curl http://h3manth.com/njs) && \
echo 'export PATH=$HOME/local/bin/:$PATH' >> ~/.bashrc && \
source ~/.bashrc && \
echo "Install npm" && \
git clone git://github.com/isaacs/npm.git && \
@amolk
amolk / remove-rubber-band-web-apps-ios
Last active May 8, 2024 17:47
Remove rubberband scrolling from web apps on mobile safari (iOS)
<!DOCTYPE html>
<html>
<head>
<title>Remove rubberband scrolling from web apps on mobile safari (iOS)</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta id="extViewportMeta" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<style>
html, body {margin: 0; padding: 0; overflow: hidden}