Skip to content

Instantly share code, notes, and snippets.

View joelmartinez's full-sized avatar
👨‍🚀
Fighting Entropy

Joel Martinez joelmartinez

👨‍🚀
Fighting Entropy
View GitHub Profile
@joelmartinez
joelmartinez / ImageDownloader.java
Created December 8, 2011 20:42
Android ImageDownloader (from random StackOverflow thread)
package com.your.project;
import java.io.IOException;
import java.io.InputStream;
import java.lang.ref.SoftReference;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.Collections;
import java.util.HashMap;
@joelmartinez
joelmartinez / gist:1283275
Created October 13, 2011 03:19
Jint for WP7 Snippet
var engine = new JintEngine();
engine.SetFunction("alert", new Action<string>(t => MessageBox.Show(t)));
engine.Run("alert('Hello World, from dynamically interpereted JavaScript on WP7!')");
@joelmartinez
joelmartinez / gist:1240580
Created September 25, 2011 13:03
Minimal C#/MongoDb HowTo
MongoServer server = MongoServer.Create("mongodb://TheUserName:ThePassword@The.Url.Com:12345/TheDatabaseId");
MongoDatabase mongo = server.GetDatabase("<TheDatabaseId>");
var employees = mongo.GetCollection<TheClass>("TheCollectionName");
var cursor = employees.FindAllAs<TheClass>();
var item = cursor.FirstOrDefault();
....
@joelmartinez
joelmartinez / GameOfLife.cs
Created September 5, 2011 03:24
Conway's Game Of Life in C#
using System;
using System.Threading.Tasks;
namespace Life
{
public class LifeSimulation
{
private bool[,] world;
private bool[,] nextGeneration;
private Task processTask;