Skip to content

Instantly share code, notes, and snippets.

View mjm918's full-sized avatar
🍻
Code & Chill

Mohammad Julfikar mjm918

🍻
Code & Chill
View GitHub Profile
@irfaan008
irfaan008 / EnableGpsAutomaticallyInAndroid.java
Last active June 25, 2020 10:26
Enable Gps automatically if it is turned off. Similar to what OLA cab does. However to comply with policy it shows a popup to user with OK and CANCEL button. Still its better than showing location setting screen to user
package com.irinnovative.enablegps;
import android.app.Activity;
import android.content.Intent;
import android.content.IntentSender;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.google.android.gms.common.api.GoogleApiClient;
@ccarrasc
ccarrasc / my-service.service
Last active November 9, 2022 15:40
Install a Node.js service for systemctl on CentOS 7
[Unit]
After=network.target
[Service]
ExecStart=/usr/bin/node /var/node/my-service/app.js
#Type=forking
Restart=always
StandardOutput=syslog
TimeoutSec=90
SyslogIdentifier=my-service