This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"github.com/jinzhu/gorm" | |
_ "github.com/lib/pq" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//If you're targeting API 22 or higher. You can use the following code to get the list of SIM Cards. You can also allow user to choose the SIM Card: | |
final ArrayList<Integer> simCardList = new ArrayList<>(); | |
SubscriptionManager subscriptionManager; | |
subscriptionManager = SubscriptionManager.from(activity); | |
final List<SubscriptionInfo> subscriptionInfoList = subscriptionManager | |
.getActiveSubscriptionInfoList(); | |
for (SubscriptionInfo subscriptionInfo : subscriptionInfoList) { | |
int subscriptionId = subscriptionInfo.getSubscriptionId(); | |
simCardList.add(subscriptionId); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//If you're targeting API 22 or higher. You can use the following code to get the list of SIM Cards. You can also allow user to choose the SIM Card: | |
final ArrayList<Integer> simCardList = new ArrayList<>(); | |
SubscriptionManager subscriptionManager; | |
subscriptionManager = SubscriptionManager.from(activity); | |
final List<SubscriptionInfo> subscriptionInfoList = subscriptionManager | |
.getActiveSubscriptionInfoList(); | |
for (SubscriptionInfo subscriptionInfo : subscriptionInfoList) { | |
int subscriptionId = subscriptionInfo.getSubscriptionId(); | |
simCardList.add(subscriptionId); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[code] | |
//If you're targeting API 22 or higher. You can use the following code to get the list of SIM Cards. You can also allow user to choose the SIM Card: | |
final ArrayList<Integer> simCardList = new ArrayList<>(); | |
SubscriptionManager subscriptionManager; | |
subscriptionManager = SubscriptionManager.from(activity); | |
final List<SubscriptionInfo> subscriptionInfoList = subscriptionManager | |
.getActiveSubscriptionInfoList(); | |
for (SubscriptionInfo subscriptionInfo : subscriptionInfoList) { | |
int subscriptionId = subscriptionInfo.getSubscriptionId(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SoftwareSerial.h> | |
SoftwareSerial A6Module(10, 11); //RX,TX | |
char input='\0'; | |
void setup() { | |
A6Module.begin(115200); | |
Serial.begin(9600); | |
delay(500); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout develop && git pull origin develop && git checkout - && git rebase - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const readline = require('readline'); | |
const {google} = require('googleapis'); | |
// If modifying these scopes, delete token.json. | |
const SCOPES = [ | |
'https://www.googleapis.com/auth/drive.metadata.readonly', | |
'https://www.googleapis.com/auth/drive.file', | |
'https://www.googleapis.com/auth/drive.metadata']; | |
// The file token.json stores the user's access and refresh tokens, and is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sometimes it's useful to start with a clean slate and remove all Docker containers and even images. Here are some handy shortcuts. | |
List all containers (only IDs) | |
docker ps -aq | |
Stop all running containers | |
docker stop $(docker ps -aq) | |
Remove all containers | |
docker rm $(docker ps -aq) | |
Remove all images | |
docker rmi $(docker images -q) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.gabesechan.android.reusable.receivers; | |
import java.util.Date; | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.telephony.TelephonyManager; | |
public abstract class PhonecallReceiver extends BroadcastReceiver { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// VCC - 5v | |
// GND - GND | |
// Tx - 10 | |
// Rx - 11 | |
#include <SoftwareSerial.h> | |
SoftwareSerial sim(10, 11); | |
int _timeout; | |
String _buffer; | |
String number = "+84985443701"; //-> change with your number |
OlderNewer