Skip to content

Instantly share code, notes, and snippets.

View will-ockmore's full-sized avatar

Will Ockmore will-ockmore

View GitHub Profile
@will-ockmore
will-ockmore / create_svg_components.py
Last active December 15, 2023 19:09
Script to convert the full-width icons and pictograms to component entries
import os
import re
import sys
from pathlib import Path
dir_path = Path(sys.argv[1] if len(sys.argv) > 1 else ".").resolve()
numbers = {
"1": "One",
"2": "Two",
from otto.clients.gandi_client import GandiClient, GandiDomainRecord
from argparse import ArgumentParser
import ujson
import requests
from tenacity import retry, retry_if_exception, stop_after_attempt, RetryCallState, wait_random
gandi = GandiClient(api_key="")
# Added a method to the gandi client
@will-ockmore
will-ockmore / rename_ivr.py
Last active February 9, 2019 12:57
Run the whole thing as a script, will handle duplicate filenames.
#!/usr/bin/env python
import os
import sys
import csv
def rename_files(csv_filename):
with open('CS_IVR_NOTES.csv', 'r') as csvfile:
csvreader = csv.reader(csvfile, delimiter=',', quotechar='"')
package main
import "golang.org/x/tour/pic"
import "math"
func makePic(f func(x, y int) uint8) func(dx, dy int) [][]uint8 {
pic := func(dx, dy int) [][]uint8 {
// 2d array of pixel values
p := make([][]uint8, dy)
for y := range p {
2017-08-30 11:01:28 digitalassess-manage:development:web - at=ERROR request_id=4db371c1d11d4a78ac7853fa892458ce logger=django.request Internal Server Error: /api/courses/
2017-08-30 11:01:28 digitalassess-manage:development:web - Traceback (most recent call last):
2017-08-30 11:01:28 digitalassess-manage:development:web - File "/Users/will/Projects/digitalassess-manage/env/lib/python3.6/site-packages/django/db/backends/base/base.py", line 213, in ensure_connection
2017-08-30 11:01:28 digitalassess-manage:development:web - self.connect()
2017-08-30 11:01:28 digitalassess-manage:development:web - File "/Users/will/Projects/digitalassess-manage/env/lib/python3.6/site-packages/django/db/backends/base/base.py", line 189, in connect
2017-08-30 11:01:28 digitalassess-manage:development:web - self.connection = self.get_new_connection(conn_params)
2017-08-30 11:01:28 digitalassess-manage:development:web - File "/Users/will/Projects/digitalassess-manage/env/lib/py
2017-08-21 10:42:05 digitalassess-manage:development:worker - <td>DISALLOWED_USER_AGENTS</td>
2017-08-21 10:42:05 digitalassess-manage:development:worker - <td class="code"><pre>[]</pre></td>
2017-08-21 10:42:05 digitalassess-manage:development:worker - </tr>
2017-08-21 10:42:05 digitalassess-manage:development:worker -
2017-08-21 10:42:05 digitalassess-manage:development:worker - <tr>
2017-08-21 10:42:05 digitalassess-manage:development:worker - <td>EMAIL_BACKEND</td>
2017-08-21 10:42:05 digitalassess-manage:development:worker - <td class="code"><pre>&#39;django.core.mail.backends.console.EmailBackend&#39;</pre></td>
2017-08-21 10:42:05 digitalassess-manage:development:worker - </tr>
2017-08-21 10:42:05 digitalassess-manage:development:worker -
2017-08-21 10:42:05 digitalassess-manage:development:worker - <tr>
@will-ockmore
will-ockmore / gist:932e9c603f13712c17b2ebe12ba12f62
Created September 29, 2016 08:51
Migration to create new models in new app
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
import django.db.models.deletion
import django.utils.timezone
import uuid
@will-ockmore
will-ockmore / gist:2faa7b97207003d667f8cdf1e7e374a8
Created September 29, 2016 08:50
Migration from original app
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0011_auto_20160922_1106')