Skip to content

Instantly share code, notes, and snippets.

View KSVarun's full-sized avatar
🧘

Varun KSVarun

🧘
View GitHub Profile
String CLIENT_ID = {{tenant Id}};
String AUTHORITY = "https://login.microsoftonline.com/{{tenant Id}}/";
String CLIENT_SECRET = {{clientSecret}};
Set<String> SCOPE = Collections.singleton("https://graph.microsoft.com/.default");
ClientCredentialProvider authProvider = new ClientCredentialProvider(
CLIENT_ID,
Arrays.asList("https://graph.microsoft.com/.default"),
CLIENT_SECRET,
{{tenant Id}},
public class GoogleSignInApplication {
private static final String APPLICATION_NAME = "Calendar";
private static final JsonFactory JSON_FACTORY = JacksonFactory.getDefaultInstance();
private static final String TOKENS_DIRECTORY_PATH = "tokens";
private static final List<String> SCOPES = Collections.singletonList(CalendarScopes.CALENDAR);
private static final String CREDENTIALS_FILE_PATH = "/client_secret.json";
private static Credential getCredentials(final NetHttpTransport HTTP_TRANSPORT) throws IOException {
@KSVarun
KSVarun / xylem_coding_challenge.py
Last active February 12, 2020 13:52
Updated solution to the xylem coding challenge
n=int(input()) #Size of array
first_arry=[] #Sorted based on number of 1's
binary_array=[] #Sorted based on number of 1's along with similar count of 1's
dict={} #Dictionary to get elements based number of 1's
ele=[]
#read array elements to ele array
for i in range(n):
#check if the number is negative
num=int(input())
@KSVarun
KSVarun / .sh
Created December 26, 2018 06:33
shell script to delete files older than 7 days
#!/bin/sh
i=0
fileDate(){
filesCount=$(ls -lrt | wc -l)
line=2
while [ $i -le $filesCount ]
do
dates[${i}]+=$(ls -lrt | awk '{print $6" "$7}' | sed -n ${line}p)