Skip to content

Instantly share code, notes, and snippets.

View shearichard's full-sized avatar

Richard Shea shearichard

View GitHub Profile
@shearichard
shearichard / q_dq_example.py
Created March 30, 2022 21:25
Example of queueing / de-queing in Python
import threading, queue
import random
import time
'''
Representaive output
$ python queue_example.py
> Submission of 0 pausing for 3
@shearichard
shearichard / django-sockpuppet-demo-list-filter.html
Created March 11, 2021 02:15
Some html associated with the increment demo of Django-Sockpuppet (line 9 and 23 is relevant)
<div>
<span class="" data-target="book-search.activity" hidden="">
<i class="fas fa-spinner fa-spin"></i>
Searching for books...
</span>
<span class="" data-target="book-search.count">
<strong>69,979</strong> books found
@shearichard
shearichard / django-sockpuppet-demo-increment.html
Created March 11, 2021 02:08
Some html associated with the increment demo of Django-Sockpuppet (line 31is the significant part)
<header class="flex py-1">
<img alt="" src="https://i.imgur.com/FX0KFM7m.jpg" style="filter: grayscale(0.9) contrast(1.2); height: 4rem;"/>
<h1 class="leading-none m-0 pl-1 self-center">
<a href="/">Sockpuppet</a>
<small>Expo</small>
</h1>
</header>
<hr/>
<flex-container>
@shearichard
shearichard / README.md
Last active November 29, 2020 22:33
Ember.js : Passing actions up through nested components

Ember.js - passing actions through nested components

Overview

This is a set of files which illustrate how actions are passed through a series of nested components. I'm putting this in a gist because this is one of those things which I often scratch my head over when I have to do it from scratch.

The example makes use of a set of components, each nested inside the other. The innermost component, test-component-inner exposes a button with the label 'PRESS ME', clicking the button has the result that a log message is written to the console by the outermost component, test-component-outer.

Application.hbs
@shearichard
shearichard / jjj
Created May 1, 2020 03:14
PNG as Data URI Test
<a href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAADfFSURBVHhe7d0JtC1FdTDgx4yK+HwIKIYIAQcwBoIKiiEYUBGHOJM4RJA4REWCqKiJSoITYhyi4JwQkThEhTgbMaBBgwIOgAODIGgEITKKzG/9qe3PZV2v977bdabuqvp6rV4L3u3Tp/bXu3dV9Tmne8UKCwECrQnslQI+Kq3fS+ulaf1kWg9I6x1agxAvAQIECBBoQeAPU5AnpvX/LbH+LP37s9K6VgsYYiRAgAABArUL3D0F+C9pXb2Gzn/+oOBbabvda0cRHwECBAgQqFUgLukfltZfdez4F14ZiI8GtqkVR1wECBAgQKA2gbVTQM9O68UjdvzzBwI3pH28Oa13qg1JPAQIECBAoCaBR6RgzpxAx7/wasBlaZ/PT+s6NWGJhQABAgQIlC5w3xTAF6bQ8S8cCMQvB+JXBBYCBAgQIECgR4HN0nu/N603z6Dznz8Y+Hx6v+16jNtbEyBAgACBZgWekyK/csYd//xBwE3pvY9M6ybNHgGBEyBAgACBGQpsm97rpB47/oUfC1yR2nJQWuPLhxYCBAgQIEBgwgLxBbyXp/W6AXX+8wcDp6R23XvCMdsdAQIECBBoWmCnFP23B9rxzx8ExODk4LS6m2DT6Sp4AgQIEBhXYMO0gyPSOusv+S11u+Cu/35yanN8VGEhQIAAAQIEMgX2SNv/qIBZ/1KDgmtT21+UGbPNCRAgQIBAswIrU+T/VHDHv3BAEF9Y3LrZoylwAgQIECDQQeDJaZtLKur85wYDv0wx/VWH+G1CgAABAgSaEogH9xxTYce/8GrACSnG323qyAqWAAECBAgsIfCH6d/PaaDznxsMXJ1ijYcVWQgQIECAQLMCB6bI44l7Xb9dX9N28eyCuzd75AVOg
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@shearichard
shearichard / components.my-component.js
Last active June 20, 2019 01:34
computed-in-component-sandbox
import Ember from 'ember';
const cctypes = [
{cctypedesc: 'Posting', cctypevalue: 'P'},
{cctypedesc: 'Summary', cctypevalue: 'S'},
];
export default Ember.Component.extend({
compText : "This is some text - R",
cctypes,
@shearichard
shearichard / controllers.application.js
Last active September 20, 2018 06:43
debounce-demo
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@shearichard
shearichard / boto3-upload-files.py
Created July 31, 2018 07:21
Example of uploading a file to S3 via boto3 without credentials in a config file or in environmental vars
import boto3
import botocore
import sys
import pprint
from boto3.s3.transfer import S3Transfer
from boto3.session import Session
def main():
#Create client
@shearichard
shearichard / boto3-list-buckets.py
Last active July 31, 2018 07:21
Example of accessing AWS via boto3 without credentials in a config file or in environmental vars
import boto3
import boto3
import botocore
import sys
def main():
client = boto3.client(
's3',
aws_access_key_id=sys.argv[1],