Skip to content

Instantly share code, notes, and snippets.

View rangav's full-sized avatar

Ranga Vadhineni rangav

View GitHub Profile
@ThomasArdal
ThomasArdal / Customer.cs
Created June 12, 2014 18:33
Elasticsearch migration c# example
namespace ConsoleApplication1
{
public class Customer
{
public int Zipcode { get; set; }
}
}
@nicwise
nicwise / PDFUtils.cs
Created April 23, 2013 12:32
PDF download and viewing - Xamarin.iOS
using System;
using System.IO;
using System.Threading.Tasks;
using MonoTouch.UIKit;
using MonoTouch.QuickLook;
using System.Net;
using MonoTouch.Foundation;
using System.Security.Cryptography;
using System.Text;
@mraaroncruz
mraaroncruz / hn.sql
Created April 2, 2013 08:29
Hacker News algorithm in SQL
SELECT x.*
FROM POSTS x
JOIN (SELECT p.postid,
SUM(v.vote) AS points
FROM POSTS p
JOIN VOTES v ON v.postid = p.postid
GROUP BY p.postid) y ON y.postid = x.postid
ORDER BY (y.points - 1)/POW((((UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(x.timestamp))/3600)+2, 1.5) DESC
LIMIT n
@rabinjoshi
rabinjoshi / RJViewController.m
Created December 9, 2012 20:37
Loading content in a WebView using NSURLConnection
@implementation RJViewController {
__weak IBOutlet UIWebView *_webView;
NSURLConnection *_urlConnection;
NSMutableData *_receivedData;
}
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *urlString = @"http://google.com";