Skip to content

Instantly share code, notes, and snippets.

View johnbender's full-sized avatar

John Bender johnbender

View GitHub Profile
var map;
function load_map(){
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map_div_12"));
map.setCenter(new GLatLng(40.73897,-74.033918),14);
//.. other map code here ..
}
}
<%= map.map.to_html :function => "load_map" %>
<%= map.map.div :width => 550, :height => 300 %>
load_map();
$("map_div").show("slow");
//calls
Method1(webToPass);
Method2(listToPass);
//definition
private void Method1 (SPWeb web)
{
web.permissions = "full";
}
class SomeController < ActionController::Base
before_filter :authenticate, :only => [:destroy]
def index
#index actions
end
def show
#index actions
end
public class SomeController : IController
{
public override void Index()
{
//Index action
}
public override void Show()
{
GITHUB_JSON_URL = "http://github.com/api/v1/json/{0}?callback={1}";
DYNAMIC_SCRIPT_TEMPLATE = "<script src='{0}' type='text/javascript' ></script>";
GITHUB_PROJECTS_CLASS = ".github-projects";
REPO_TEMPLATE =
"<div class='github-repo'>"
+ "<a href='{0}' target='_blank'>"
+ "{1}<img class='github-repo-link-image'"
+ "src='http://erlanguid.com/icons/external.png'"
+ "</a>"
+"</div>";
var GitHubRepos = new function(){
this.displayObjects = new Array();
//retrieve the repo information from github
this.GetRepos = function()
{
//...
}
this.GetRepos = function()
{
//create an array of the github data, used to prevent mutiple hits
//to the server for the same user
var github_usernames = new Array();
//for all the github-projects divs
$(GITHUB_PROJECTS_CLASS).each(function(i) {
//create an array of all unique userids in the page
<div class="github-projects" id="johnbender" style="display: block;">
<div class="github-projects-title">GitHub Projects</div>
</div>