Skip to content

Instantly share code, notes, and snippets.

View DecisionNerd's full-sized avatar

David Spencer DecisionNerd

View GitHub Profile
@DecisionNerd
DecisionNerd / ChatGPTphoneAuth.vue
Last active January 20, 2023 02:17
generate a template and script in vue 3 using firebase/auth SDK version 9 signInWithPhoneNumber verifyRecaptcha. use tailwindcss. template has input for phone and input for otp code appears after submitting phone number.
<!-- Here is a template and script for a Vue 3 component that uses Firebase/Auth SDK version 9 to implement
phone number authentication with reCAPTCHA verification: -->
<template>
<div class="container mx-auto">
<form @submit.prevent="submitPhoneNumber" class="bg-white p-6 rounded-lg shadow-md">
<label class="block font-medium text-gray-700 mb-2">
Phone Number
</label>
<input
v-model="phoneNumber"
@DecisionNerd
DecisionNerd / neo4j.py
Created March 14, 2022 06:16 — forked from korakot/neo4j.py
Using Neo4j in Colab
# download 3.5.8 or neo4j-enterprise-4.0.0-alpha09mr02-unix
!curl https://neo4j.com/artifact.php?name=neo4j-community-3.5.8-unix.tar.gz -o neo4j.tar.gz
# decompress and rename
!tar -xf neo4j.tar.gz # or --strip-components=1
!mv neo4j-community-3.5.8 nj
# disable password, and start server
!sed -i '/#dbms.security.auth_enabled/s/^#//g' nj/conf/neo4j.conf
!nj/bin/neo4j start
@DecisionNerd
DecisionNerd / csv2json.sh
Created November 13, 2015 03:13
CSV to JSON converter using BASH. Original script from http://blog.secaserver.com/2013/12/convert-csv-json-bash/
#!/bin/bash
# CSV to JSON converter using BASH
# original script from http://blog.secaserver.com/2013/12/convert-csv-json-bash/
# thanks SecaGuy!
# Usage ./csv2json.sh input.csv > output.json
input=$1
[ -z $1 ] && echo "No CSV input file specified" && exit 1
[ ! -e $input ] && echo "Unable to locate $1" && exit 1
@DecisionNerd
DecisionNerd / nb_datatables_mode.py
Created March 29, 2020 15:21
jupyter-datatables mode enable
# https://pypi.org/project/jupyter-datatables/
!pip install jupyter-datatables
from jupyter_datatables import init_datatables_mode
init_datatables_mode()
#!/bin/bash
# Adds R to apt and install it
#
# Instructions:
# sudo chmod 700 InstallR.sh
# ./FirstTimeInstallR.sh
# Install R
sudo echo "deb http://cran.rstudio.com/bin/linux/ubuntu xenial/" | sudo tee -a /etc/apt/sources.list
@DecisionNerd
DecisionNerd / gist:35833e912c9110958fac874d0ef7388e
Last active December 31, 2017 03:16
Raspbian Keyboard reconfiguration Instructions
sudo dpkg-reconfigure keyboard-configuration #to reconfigure your keyboard.
#Choose English (US) for keyboard layout (second page of configuration).
#Then either reboot or
invoke-rc.d keyboard-setup start #to reload the keymap.Code: Select all
@DecisionNerd
DecisionNerd / algebraL2P7.py
Created May 2, 2013 03:33
Python function for solving the polynomial substitution problems in Udacity College Algebra Lesson 2 Problem 7 (SJSU MA008)
def l2p7(x):
ans = (3+x)/(x**2.)
print ans
@DecisionNerd
DecisionNerd / algebraL2P6.py
Last active December 16, 2015 21:29
Python function for solving the polynomial substitution problems in Udacity College Algebra Lesson 2 Problem 6 (SJSU MA008)
def l2p6(x):
ans = (x**3)+(2*(x**2))+(3*x)-2
print ans
<!DOCTYPE html>
<html>
<head>
<title>Leaflet</title>
<link rel="stylesheet" href="http://code.leafletjs.com/leaflet-0.3.1/leaflet.css" />
<script src="http://code.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script>
<script src="https://raw.github.com/gist/2197042/2b90c41b39b7d5b3a851d8f256de2ebd3fe1fb74/leaflet-google.js"></script>
</head>
<body>
input {
http_poller {
# List of urls to hit
# URLs can either have a simple format for a get request
# Or use more complex HTTP features
urls => {
BWI => "http://services.faa.gov/airport/status/BWI?format=application/json"
IAD => "http://services.faa.gov/airport/status/IAD?format=application/json"
DCA => "http://services.faa.gov/airport/status/DCA?format=application/json"
}