Skip to content

Instantly share code, notes, and snippets.

View ThinkDigitalSoftware's full-sized avatar
💭
An app a day keeps the doctor away

Jonathan White ThinkDigitalSoftware

💭
An app a day keeps the doctor away
  • ThinkDigitalSoftware
  • California, United States of America
View GitHub Profile
@ThinkDigitalSoftware
ThinkDigitalSoftware / getElementByXPath.js
Created April 14, 2018 20:25
Allows searching with an XPath copied directly from Chrome
function getElementByXpath(xpath){
return document.evaluate(`${xpath}`, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
}
@ThinkDigitalSoftware
ThinkDigitalSoftware / eventFire.js
Last active April 14, 2018 20:35
Simulate a click on a Javascript Element. Credit goes to KooiInc, https://stackoverflow.com/a/2706236/2880055
function eventFire(el, etype){
//Usage: eventFire(document.getElementById('mytest1'), 'click');
if (el.fireEvent) {
el.fireEvent('on' + etype);
} else {
var evObj = document.createEvent('Events');
evObj.initEvent(etype, true, false);
el.dispatchEvent(evObj);
}
@ThinkDigitalSoftware
ThinkDigitalSoftware / main.dart
Last active April 24, 2018 03:04
Digital Dice Practice Code
import 'dart:math';
import 'dart:io';
main(List<String> arguments) {
print("This is a digital dice program. Press enter to roll!");
print("Enter Q or q to quit.");
int numOfDieToRoll;
var _data = {"type":"FeatureCollection","metadata":{"generated":1527038299000,"url":"https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.geojson","title":"USGS All Earthquakes, Past Day","status":200,"api":"1.5.8","count":340},"features":[{"type":"Feature","properties":{"mag":1.7,"place":"15km NW of Fernley, Nevada","time":1527037828020,"updated":1527037983611,"tz":-480,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/nn00636565","detail":"https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/nn00636565.geojson","felt":null,"cdi":null,"mmi":null,"alert":null,"status":"automatic","tsunami":0,"sig":44,"net":"nn","code":"00636565","ids":",nn00636565,","sources":",nn,","types":",geoserve,origin,phase-data,","nst":22,"dmin":0.031,"rms":0.09,"gap":125.64,"magType":"ml","type":"earthquake","title":"M 1.7 - 15km NW of Fernley, Nevada"},"geometry":{"type":"Point","coordinates":[-119.3635,39.713,3.6]},"id":"nn00636565"},
{"type":"Feature","properties":{"mag":0.47,"place":"11km NE of Aguanga, CA
import 'dart:async';
import 'dart:io';
void main(){
print(imConnected());
}
imConnected() async {
try {
final result = await InternetAddress.lookup('google.com');
import 'dart:async';
import 'dart:io';
main(List<String> arguments) async{
for (var i = 0; i < 10; i++) {
write(i.toString());
}
var fileContents = await readFile();
@ThinkDigitalSoftware
ThinkDigitalSoftware / login_page.dart
Created June 26, 2018 19:16
Boolean Expression must not be null error
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:html/dom.dart' as dom;
import 'package:html/parser.dart';
import 'package:http/http.dart';
import '../live_kh.dart';
import 'package:flutter/cupertino.dart';
import 'hall_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
main(List<String> arguments) {
runApp(new MaterialApp(
title: "Test",
home: CongregationImage(
isLoading: true,
screenHeight: 100.0,
orientation: Orientation.portrait,
@ThinkDigitalSoftware
ThinkDigitalSoftware / NSAppTransportSecurity
Created July 21, 2018 03:59
Allow insecure connections through HTTP. This goes in your Info.plist
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>livekingdomhall.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
#THIS NEEDS SUPER USER ACCESS. Verify that you want to do this first, since rm -rf asks no questions!
#Copy and past this in your terminal when you are ready. I hold no liability for your choice.
sudo rm -rf "/Applications/GarageBand.app"
sudo rm -rf "/Library/Application Support/GarageBand"
sudo rm -rf "/Library/Application Support/Logic"
sudo rm -rf "/Library/Audio/Apple Loops"