Skip to content

Instantly share code, notes, and snippets.

import sqlite3, os
conn = sqlite3.connect('Mills1860.mbtiles')
results=conn.execute('select * from tiles').fetchall()
for result in results:
zoom, column, row, png= result
try:
os.makedirs('%s/%s/' % (zoom, row))
public with sharing class ViewStateStudy_controller {
public String accId{get;set;}
public Account account{get;set;}
public ViewStateStudy_controller()
{
accId = ApexPages.currentPage().getParameters().get('Id');
if(accId != null)
{
/*
* Copyright (c) 2013 CloudClickware
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
* and associated documentation files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial
public class InputfieldDemoController {
//Variable under test
public String valuefromJS {get; set;}
public pagereference someMethod(){
System.debug(valuefromJS);
return null;
package com.appspot.dangt85.controllers;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
package com.appspot.dangt85.controllers;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/* SF OAuth request, redirect to SF login */
app.get('/oauth/auth', function(req, res) {
res.redirect(oauth2.getAuthorizationUrl({scope: 'api id web'}));
});
/* OAuth callback from SF, pass received auth code and get access token */
app.get('/oauth/callback', function(req, res) {
var conn = new jsforce.Connection({oauth2: oauth2});
var code = req.query.code;
conn.authorize(code, function(err, userInfo) {
/* SF OAuth request, redirect to SF login */
app.get('/oauth/auth', function(req, res) {
res.redirect(oauth2.getAuthorizationUrl({scope: 'api id web'}));
});
/* OAuth callback from SF, pass received auth code and get access token */
app.get('/oauth/callback', function(req, res) {
var conn = new jsforce.Connection({oauth2: oauth2});
var code = req.query.code;
conn.authorize(code, function(err, userInfo) {
<!--
Author - Mohit Shrivastav
Co-Author - Harshit Pandey (Revised Code)
// ======== Angular JS with Visualforce ====
This page list down the fields of Account and list the fields by Querying Salesforce
User can search sort and paginate the data presentation pretty quickly and fancy way
using Angular.JS
-->
@doppiomacchiatto
doppiomacchiatto / app.js
Created November 23, 2015 21:42 — forked from thekarel/app.js
AngularJS: Multiple controllers and 1 ng-view on the same page, plus embedded directives
/**
* Create the app
*/
var appOne = angular.module('appOne', ['ngRoute']);
/**
* Configure routing - so controllerTwo runs
*/
appOne.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/', {