Skip to content

Instantly share code, notes, and snippets.

View sivakumarbdu's full-sized avatar

Sivakumar Vadivelu sivakumarbdu

View GitHub Profile
@sivakumarbdu
sivakumarbdu / ruby-mongo-connect
Created January 6, 2012 12:50
Connect to Mongo DB from ruby
require 'mongo'
dbase = Mongo::Connection.new("localhost",27017).db("person")
person_collection = db.collection("interest")
person_collection.find().each do |row|
p row.inspect
end
@sivakumarbdu
sivakumarbdu / typoscript-menu
Created February 10, 2012 12:59
typoscript Reference
#TYPOSCRIPT TOREAD RECORD FROM THE TABLE
lib.content = RECORDS
lib.content.tables =tt_content
lib.content.source = 638
#TYPO3 HEADERS
page.headerData.4=TEXT
page.headerData.4.value= <link rel="stylesheet" type="text/css" media="all" href="/fileadmin/templates/css/style.css" />
@sivakumarbdu
sivakumarbdu / typoe-awstats-conf
Created February 10, 2012 13:01
typo3-awstats-logs conf
config.stat = 1
config.stat_apache = 1
config.stat_apache_logfile = statistics_typo3_log.txt
config.stat_apache_pagenames = [request_uri]
@sivakumarbdu
sivakumarbdu / typoe-page-title-level
Created February 10, 2012 13:04
typo3 Page Level title
lib.nav = RECORDS
lib.nav {
source.data = leveluid:1
tables = pages
conf.pages = TEXT
conf.pages.field = nav_title
}
lib.nav = RECORDS
@sivakumarbdu
sivakumarbdu / typoe-menu
Created February 10, 2012 13:06
typo3-left-menu
lib.nav.menu = COA
lib.nav.menu {
wrap = <ul id="menu" class="123">|</ul>
20 = HMENU
20 {
special = directory
special.value =514 #menu starting page id
@sivakumarbdu
sivakumarbdu / Typo3-page-render
Created February 10, 2012 13:10
Typo3 Template Render (Automake template)
plugin.tx_automaketemplate_pi1 {
relPathPrefix = fileadmin/templates/
content = FILE
# Filename to template file: (1)
content.file = fileadmin/templates/home.html
}
page.20 = TEMPLATE
page.20.template =< plugin.tx_automaketemplate_pi1
@sivakumarbdu
sivakumarbdu / gist:3162336
Created July 23, 2012 06:55 — forked from jrochkind/gist:2161449
A Capistrano Rails Guide

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

@sivakumarbdu
sivakumarbdu / android-current-location
Created December 13, 2012 11:31
Get current location - Android
public Location getCurrentLocation() {
locManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
locManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,
this);
Location location = locManager
.getLastKnownLocation(LocationManager.GPS_PROVIDER);
return location;
}
void setupMapView() {
setContentView(R.layout.activity_main);
mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
}
Location getCurrentLocation() {
Location location;
locManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
locManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,
package com.mapexample.mapexample;
import java.io.InputStream;
import java.util.ArrayList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;