xcode-select --install
to makegit
work- download Google Drive or "Backup & Sync" or whatever they are calling it these days
- download 1Password https://1password.com/
- open 1P and sync the password VAULT
- once XCode has finished, start doing command line things
git clone https://github.com/phette23/dotconfig.git
git clone https://github.com/phette23/bashrc.git
git clone https://github.com/phette23/fishrc.git
- these all have bash
./copy.sh
scripts to install them
- run the set up scripts from dotconfig:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
set USER username | |
set PASS password | |
set COLLECTION 123456 | |
set JSONFILE data.json | |
set URLSFILE urls.txt | |
set DONEFILE done.txt | |
set LIMIT 8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python3 | |
import sys | |
import argparse | |
import requests | |
import urllib3 | |
from panopto_folders import PanoptoFolders | |
from os.path import dirname, join, abspath | |
sys.path.insert(0, abspath(join(dirname(__file__), '..', 'common'))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NOTE: make sure the course-list query returns the courses you want and also that the right backup is | |
# referenced in the course-restore command. The query should probably use shortnames (e.g. example is | |
# all First Year 4D courses), as opposed to something like categories, because you can target metacourses. | |
for id in $(moosh -n course-list -i 'shortname LIKE "FYCST-1120%-2021SP"'); do | |
moosh -n course-restore --overwrite ~/backup-*.mbz $id; | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT b.id, b.blockname, b.parentcontextid, c.id, c.shortname | |
FROM {prefix}_block_instances b | |
JOIN (SELECT * FROM {prefix}_context WHERE contextlevel = 50) ctx ON b.parentcontextid = ctx.id | |
JOIN {prefix}_course c ON c.id = ctx.instanceid | |
-- this list of block types might need to be changed depending on Moodle instance | |
WHERE b.blockname IN ('search_forums', 'recent_activity', 'calendar_upcoming', 'news_items') | |
-- must be a better way but I just look for blocks in courses we know have duplicates | |
-- so we use the other query as a sub-query | |
AND c.id IN ( | |
SELECT c.id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env bash | |
# Google Drive messes up file modes by setting everything to 644 so all your executables are screwed up | |
# I store a bunch of git repos in a Drive folder (don't ask why) & this fixes the file modes by just checking out everything | |
for dir in $(ls -d */); do | |
cd ${dir} | |
git status 2&>/dev/null && git checkout -- . | |
cd - | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
# loop over repos and create local & remote "main" branches | |
set dirs (exa -D) # or could do the less elegant `ls -d */` | |
for dir in $dirs | |
set_color --bold | |
echo "Entering $dir" | |
set_color normal | |
cd $dir | |
# test for git repo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// only add if not already there, add as last subject with "local" authority | |
if (!xml.contains('mods/subject/topic', 'Oakland Campus Legacy')) { | |
var len = xml.count('mods/subject') | |
xml.set('mods/subject[' + len + ']/@authority', 'local') | |
xml.set('mods/subject[' + len + ']/topic', 'Oakland Campus Legacy') | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setTimeout(() => { | |
libScope(angular.element('html').scope()); | |
}, 1000); | |
function libScope(scope) { | |
// Watch results feed for changes... | |
scope.$watchCollection('feed', () => { | |
// give AngularJS time to update the DOM | |
// Probably need to wait a few seconds before running this to make sure the DOM loads | |
setTimeout(function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.get('https://library.cca.edu/cgi-bin/koha/svc/report?id=130', function(data) { | |
// header row | |
let html = '<table><thead><th>Field One</th><th>Field Two</th><th>Field Three</th></thead><tbody>' | |
// content rows | |
data.forEach(row => { | |
html += '<tr>' | |
row.forEach(value => html += `<td>${value}</td>`) | |
html += '</tr>' | |
}) | |
// close tags (optional), add to DOM |