Skip to content

Instantly share code, notes, and snippets.

View logan4dog's full-sized avatar
💭
I may be slow to respond.

Jim Logan logan4dog

💭
I may be slow to respond.
  • Bloomfield, Indiana
  • 16:37 (UTC -04:00)
View GitHub Profile
@logan4dog
logan4dog / rust-xp-02-postgresql-sqlx.rs
Created February 10, 2024 21:19 — forked from jeremychone/rust-xp-02-postgresql-sqlx.rs
Rust to PostgreSQL with SQLX | Rust By Example
#![allow(unused)] // silence unused warnings while exploring (to comment out)
use sqlx::postgres::{PgPoolOptions, PgRow};
use sqlx::{FromRow, Row};
// Youtube episode: https://youtu.be/VuVOyUbFSI0
// region: Section
// Start postgresql server docker image:
@logan4dog
logan4dog / boot-test.markdown
Last active November 3, 2019 22:53
boot test
@logan4dog
logan4dog / gist:62c4067d3ebc577e20eeba807a86370c
Created May 7, 2017 17:12
lxml xpath web scraping for the interior dept page table of monuments Donald J Trump wants to reduce in size or elimate all together
import requests
from lxml import html
pageContent=requests.get('https://www.doi.gov/pressreleases/interior-department-releases-list-monuments-under-review-announces-first-ever-formal')
tree = html.fromstring(pageContent.content)
#monument
tree.xpath('//*[@property="content:encoded"]//tr/td[1]/text()')
#location
tree.xpath('//*[@property="content:encoded"]//tr/td[2]/text()')
#years
tree.xpath('//*[@property="content:encoded"]//tr/td[3]/text()')
@logan4dog
logan4dog / magnifico.html
Created June 29, 2016 23:22 — forked from pamelafox/magnifico.html
magnifico example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>New Webpage</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.0.0/magnific-popup.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="
https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.0.0/jquery.magnific-popup.js"></script>
<a class="image-link" href="https://www.kasandbox.org/programming-images/animals/butterfly.png">Open popup!</a>
@logan4dog
logan4dog / slideshow.js
Created June 29, 2016 23:20 — forked from pamelafox/slideshow.js
slideshow.js
/**
* This function takes in a reference to a DOM element,
* assumes each of its children are <img> tags,
* and then makes a simple slideshow out of the images.
* @param container A DOM element
*/
var slideShow = function(container) {
this.images = [];
this.curImage = 0;
for (i = 0; i < container.childElementCount; i++) {