Skip to content

Instantly share code, notes, and snippets.

Avatar

Judd Lyon juddlyon

View GitHub Profile
@juddlyon
juddlyon / craftUsers.xml
Created Jun 19, 2020
CraftCMS Users XML Template for FeedMe
View craftUsers.xml
<?xml version="1.0"?>
{%- for user in craft.users.addSelect(['users.password']).all() -%}
<craftUser>
<id>{{ user.id }}</id>
<username>{{ user.username }}</username>
<name>{{ user.name }}</name>
<firstName>{{ user.firstName }}</firstName>
<lastName>{{ user.lastName }}</lastName>
<email>{{ user.email }}</email>
<hashedPassword>{{ user.password }}</hashedPassword>
@juddlyon
juddlyon / bloglovin.py
Created Mar 20, 2020
Create CSV list of blogs from Bloglovin
View bloglovin.py
#!/usr/bin/python3
import requests
import csv
api_base_url = 'https://www.bloglovin.com/api'
url = api_base_url + '/v2/search?q=mensfashion&t=true'
# cat URI format: /v2/blogs/21?page=1&country=us
# search URI format: /v2/search?q=mensfashion&t=true
@juddlyon
juddlyon / craft3-bootstrap4-pagination.twig
Created Aug 15, 2019
Craft 3 Pagination with Bootstrap 4
View craft3-bootstrap4-pagination.twig
{# - https://getbootstrap.com/docs/4.0/components/pagination/ -#}
{# - https://docs.craftcms.com/v3/dev/tags/paginate.html -#}
{%- set query = craft.entries.section('yourSectionHandle').limit(10) -%}
{%- paginate query as pageInfo, pageEntries -%}
<ol>
{%- for entry in pageEntries -%}
<li><a href="{{ entry.url }}">{{ entry.title }}</a></li>
{%- endfor -%}
@juddlyon
juddlyon / post-form-handler.php
Created May 22, 2016
GA Programming for Non-programmers POST Form Handler
View post-form-handler.php
<?php
$servername = "example.org";
$database = "your_db_name";
$username = "your_username";
$password = "your_password";
try {
$conn = new PDO("mysql:host=$servername;dbname=$database", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
@juddlyon
juddlyon / post-form.php
Created May 22, 2016
GA Programming for Non-programmers POST Form
View post-form.php
<!DOCTYPE html>
<html lang="en">
<head>
<title>Form POST</title>
<link rel="stylesheet" href="my-rad-styles.css">
</head>
<body>
<div class="main-content">
<h1>Form POST Request Example</h1>
@juddlyon
juddlyon / page2.html
Created Dec 26, 2015
GA Programming for Non-programmers Page2
View page2.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>My Awesome Website - Page 2</title>
<link rel="stylesheet" type="text/css" href="css/app.css">
<script src="behavior.js"></script>
</head>
<body>
<section class="main">
@juddlyon
juddlyon / app.css
Created Dec 26, 2015
GA Programming for Non-programmers CSS File
View app.css
body {
background-color: #FF0080;
}
.main {
background-color: white;
width: 50%;
margin: 0 auto 50px auto;
padding: 30px;
border: 5px solid orange;
@juddlyon
juddlyon / index.html
Created Dec 26, 2015
GA Programming for Non-programmers HTML File
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>My Awesome Website</title>
<link rel="stylesheet" type="text/css" href="css/app.css">
<script src="behavior.js"></script>
</head>
<body>
<!-- here's my awesome comment -->
@juddlyon
juddlyon / purecss-breakpoints
Created Jun 18, 2015
PureCSS RWD Default Breakpoints
View purecss-breakpoints
/* small (568px) */
@media screen and (min-width: 35.5em) {
}
/* medium (768px) */
@media screen and (min-width: 48em) {
}
@juddlyon
juddlyon / jquery-mobile-pagecontainer-widget-events
Created Dec 6, 2014
jQuery Mobile Pagecontainer Widget Events (v1.4.5)
View jquery-mobile-pagecontainer-widget-events
// jQuery Mobile Pagecontainer Widget Events (v1.4.5)
$(document).on('pagecontainerbeforechange', function(event, ui) {
console.log('pagecontainerbeforechange');
});
$(document).on('pagecontainerbeforehide', function(event, ui) {
console.log('pagecontainerbeforehide');
});
$(document).on('pagecontainerbeforeload', function(event, ui) {
console.log('pagecontainerbeforeload');
});
You can’t perform that action at this time.