Skip to content

Instantly share code, notes, and snippets.

View judismith's full-sized avatar

Judi Smith judismith

  • PJS Engineering
  • Phoenix
View GitHub Profile
@judismith
judismith / Folders to List.applescript
Created June 13, 2013 13:57
Name of subfolders to text file as list
tell application "Finder"
set AppleScript's text item delimiters to "
"
set myProjects to get name of folders of folder "Macintosh HD:Users:judis:Google Drive:Matters:" as text
set thePath to (path to documents folder as text) & "projects.csv"
set NewFile to open for access file thePath with write permission
write myProjects to NewFile as «class utf8»
close access NewFile
set AppleScript's text item delimiters to " "
myProjects
@judismith
judismith / PdDFPen-Pro-Reverse-Page-Order.scpt
Created January 30, 2018 16:08
Apple Script to reverse page order in PDFPen Pro
tell application "PDFpenPro"
tell document of front window
set totalPages to count of pages
set pageNo to totalPages - 1
repeat while pageNo ≥ 1
move page pageNo to page (totalPages + 1)
set pageNo to pageNo - 1
end repeat
end tell
end tell
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using MvvmCross.Plugins.Sqlite;
namespace ****.Repositories
{
public interface IRepository<T>
{
@judismith
judismith / GetParentControl.cs
Last active December 31, 2020 16:00
Xamarin : Method to find ascendant parent of type T of a control.
private static T GetParentControl<T>(View control) where T : SfTextInputLayout
{
if (control == null) return null;
var parent = control.Parent;
while (parent != null)
{
if (parent is T) return parent as T;
@judismith
judismith / GetAllControlsOfType<T>
Created December 31, 2020 19:23
Xamarin : Get all the child controls of type<T> of a form by sending in the root control (ContentPage)
private static IList<T> GetAllControlsOfType<T>(Element view) where T : View
{
var rtn = new List<T>();
foreach (View item in view.Descendants())
{
var ctr = item as T;
if (ctr != null)
{
rtn.Add(ctr);
}
@judismith
judismith / Parse_RSS_Feed.cs
Created April 29, 2024 01:31
Parse RSS Feed from Wordpress Blog
using System.ServiceModel.Syndication;
using System.Xml;
using System.Xml.Linq;
string url = "https://shaolinarts.com/feed/rss/";
XmlReader reader = XmlReader.Create(url);
SyndicationFeed feed = SyndicationFeed.Load(reader);
reader.Close();
foreach (SyndicationItem item in feed.Items)