Skip to content

Instantly share code, notes, and snippets.

View galex's full-sized avatar

Alexander Gherschon galex

View GitHub Profile
@galex
galex / gist:631844
Created October 18, 2010 07:05
geotoolkit-lambert72-to-wgs84
CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:9803") ;
CoordinateReferenceSystem targetCRS = DefaultGeographicCRS.WGS84;
MathTransform tr = CRS.findMathTransform(sourceCRS, targetCRS);
DirectPosition sourcePt = new GeneralDirectPosition(coordinates.getDouble(0), coordinates.getDouble(1), 0);
DirectPosition targetPt = tr.transform(sourcePt, null);
System.out.println("Source point: " + sourcePt);
System.out.println("Target point: " + targetPt);
@galex
galex / gist:631791
Created October 18, 2010 05:51
android app blocks device from going into sleep/stand by mode
public class MyActivity extends Activity {
// define the wakeLock as attribute
PowerManager.WakeLock wakeLock ;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// problem when closing the app, this one crashed without any reason
bindService(new Intent(this, PlayerService.class), this.playerServiceConnection, Context.BIND_AUTO_CREATE);
// solution
bindService(new Intent(this, PlayerService.class), this.playerServiceConnection, Context.BIND_DEBUG_UNBIND);
@galex
galex / post-receive
Created November 27, 2009 13:35
File to put in each git-repository/hooks/ folder, for each project, to notifity Integrity to get this new build and test it.
#!/usr/bin/env ruby
# Replace the following by the url given to you in your project's edit page
POST_RECEIVE_URL = 'http://integrity.url.com/project_name/push'
# Set user and password if Integrity is protected with basic auth
USER = "***"
PASSWORD = "***"
#######################################################################