Skip to content

Instantly share code, notes, and snippets.

View phpmaps's full-sized avatar
💭
Lending a helping hand on the web.

Doug Carroll phpmaps

💭
Lending a helping hand on the web.
View GitHub Profile
import org.junit.jupiter.api.Test;
import org.skyscreamer.jackson.databind.ObjectMapper;
import static org.junit.jupiter.api.Assertions.*;
public class JsonObjectPropertyTest {
@Test
public void testJsonObjectHasProperty() throws Exception {
String jsonString = "{\"name\": \"John Doe\", \"age\": 30}";
@phpmaps
phpmaps / gist:70497b1ed667495ecc4fe962c80c590d
Created March 3, 2024 18:03
Permission denied Geolocation
navigator.geolocation.watchPosition(function(position) {
console.log("i'm tracking you!");
},
function(error) {
if (error.code == error.PERMISSION_DENIED)
console.log("you denied me :-(");
}
);
@phpmaps
phpmaps / csv-read.py
Created November 15, 2023 23:40
Python CSV
import pandas as pd
# Specify the CSV file path
csv_file_path = 'your_file.csv'
# Specify the column name you want to print
column_name = 'your_column_name' # Change this to the actual column name
# Read the CSV file into a pandas DataFrame
df = pd.read_csv(csv_file_path)
@phpmaps
phpmaps / silent.js
Created October 26, 2023 13:24
Cordova hide from UI
// Do this to test faceMatch non-UI API
cordova.exec(function(data) {
console.log("face match Success: "+data);
myObj = JSON.stringify(data);
finishOnboarding();
}, function(err) {
console.log("Error faceMatch: "+ err);
finishOnboarding();
}, "Cplugin", "faceMatch", []);
@phpmaps
phpmaps / stringDate.js
Created August 24, 2023 02:24
Javascript fun string date
const stringDate = () => {
const d = new Date();
d.setHours(d.getHours() - 8);
return `${d.getUTCMonth() + 1}-${d.getUTCDate()}-${d.getUTCFullYear()}-${d.valueOf()}`;
}
console.log(stringDate()); // "8-23-2023-1692814955203"
<div class="score-badge total green">
<span class="text span gray">total score</span>
<span class="score-badge__number green total">91.1</span>
</div>
@phpmaps
phpmaps / spinner.css
Created June 16, 2023 13:48
spinner
.spinner-container {
display: flex;
width: 100%;
justify-content: center;
align-items: center;
}
@keyframes spinner {
0% {
transform: rotate(0deg);
@phpmaps
phpmaps / react-native-webview.js
Created March 4, 2023 17:23
Camera react-native-webview
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
*/
import React from 'react';
import { WebView } from 'react-native-webview';
@phpmaps
phpmaps / STEPS.md
Last active December 8, 2022 15:50
Optimized Launcher App - Incode

Implementation Options

Use the new API parameters to create an optimized onborading application

Include clientId, componenets and tag in the omni/onboarding-url options, as follows.

GET /omni/onboarding-url?clientId={{client-id}}&components=qr&tag=payments

Will fetch onboarding URL

@phpmaps
phpmaps / har_to_excel.py
Last active November 14, 2022 17:25
HAR to Excel
import pandas as pd
import argparse
import json
import urllib.parse
from urllib.parse import urlparse
arr = []
def har(harfile_path):
harfile = open(harfile_path)