Skip to content

Instantly share code, notes, and snippets.

View koush's full-sized avatar

Koushik Dutta koush

View GitHub Profile
<script>
function generatelink() {
var rn = $("#romname")[0];
var ru = $("#romurl")[0];
var bitly = 'https://tickleservice.appspot.com/authorizedtickle?applicationId=ROM Manager&data.url=' + escape(ru.value) + "&data.name=" + rn.value + "&failure_redirect=" + escape('http://rommanager.appspot.com/webconnectfailure.html') + "&success_redirect=" + escape('http://rommanager.appspot.com/webconnectsuccess.html');
$.ajax({
url: "http://api.bit.ly/v3/shorten?login=koush&apiKey=R_b12315a324b430e592df51c655fa2691&longUrl=" + escape(bitly),
type: "GET",
dataType: "jsonp",
success: function(msg) {
void downloadFile(String url, String referer) throws Exception {
Log.i(LOGTAG, "Attempting download of " + url);
URL downloadUrl = new URL(url);
final File filePath = Helper.computeFilePath(downloadUrl);
Log.i(LOGTAG, "Downloading: " + downloadUrl);
URLConnection conn = downloadUrl.openConnection();
if (!Helper.isJavaScriptNullOrEmpty(referer))
conn.addRequestProperty("Referer", referer);
final int totalSize = conn.getContentLength();
DataInputStream input = new DataInputStream(conn.getInputStream());
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/__init__.py", line 511, in __call__
handler.get(*groups)
File "/Volumes/Data/ROMManagerService/src/nightlies.py", line 8, in get
nightlies_page = urllib.urlopen('http://mirror.kanged.net/cm/nightly/');
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib.py", line 82, in urlopen
opener = FancyURLopener()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib.py", line 611, in __init__
URLopener.__init__(self, *args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib.py", line 129, in __init__
Configuring package: main
-------------------------
Configuration options: --disable-update-mimedb --disable-update-desktopdb --disable-gnomeplatform --enable-macplatform --enable-tests
Running aclocal -I /Library/Frameworks/Mono.framework/Versions/Current/share/aclocal ...
Running automake --foreign ...
Running autoconf ...
Running ./configure --enable-maintainer-mode --enable-compile-warnings --prefix=/usr/local --disable-update-mimedb --disable-update-desktopdb --disable-gnomeplatform --enable-macplatform --enable-tests ...
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
public static GregorianCalendar getSynchronizedTime() {
// this time zone is the local time zone
GregorianCalendar greg = new GregorianCalendar();
// find the offset from GMT and adjust accordingly.
// server is in GMT
int offset = greg.getTimeZone().getOffset(greg.getTimeInMillis());
greg.add(GregorianCalendar.MILLISECOND, -offset);
return greg;
}
using System;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Collections;
using System.Net;
namespace test2
{
public static class Extensions
package com.koushikdutta.rommanager;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import android.util.Log;
int
mmc_raw_copy (const MmcPartition *partition, char *in_file) {
int ch;
FILE *in;
FILE *out;
int val = 0;
char buf[512];
unsigned sz = 0;
unsigned i;
diff -r 78fcda0bf780 Community.CsharpSqlite.WindowsPhone7/Community.CsharpSqlite.WindowsPhone7.csproj
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Community.CsharpSqlite.WindowsPhone7/Community.CsharpSqlite.WindowsPhone7.csproj Fri Nov 12 17:05:42 2010 -0800
@@ -0,0 +1,319 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>10.0.20506</ProductVersion>
var json = JObject.Parse(e.Result);
var entries = json["feed"]["entry"];
var picturesWithNumbers =
from entry in entries
let numbers = entry["gd$phoneNumber"]
let link = entry["link"]
let image = (from linkEntry in link where linkEntry["rel"].Value<string>() == "http://schemas.google.com/contacts/2008/rel#photo" select linkEntry).FirstOrDefault()
where numbers != null && link != null &&
image != null
select new