Skip to content

Instantly share code, notes, and snippets.

@chorsnell
chorsnell / lrceth_prices.py
Last active Dec 23, 2021
Raspberry Pi Zero W + Waveshare 2.13 V2 e-ink HAT. Get LRC + ETH prices from Coingecko every minute
View lrceth_prices.py
#!/usr/bin/python
# -*- coding:utf-8 -*-
import sys
import os
import operator
picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic')
libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib')
if os.path.exists(libdir):
sys.path.append(libdir)
@chorsnell
chorsnell / oktaLogin.js
Created Dec 3, 2020 — forked from ndavis/oktaLogin.js
Cypress Custom Command for Okta Login
View oktaLogin.js
Cypress.Commands.add('loginOkta', () => {
const optionsSessionToken = {
method: 'POST',
url: Cypress.env('session_token_url'),
body: {
username: Cypress.env('username'),
password: Cypress.env('password'),
options: {
warnBeforePasswordExpired: 'true'
}
@chorsnell
chorsnell / rw_ro_access.sql
Created Nov 16, 2020 — forked from checco/rw_ro_access.sql
How to create a read only user in AWS RDS PostgreSQL and a user with superuser privileges on AWS RDS PostgreSQL
View rw_ro_access.sql
--
-- Read only
--
-- Create a group
CREATE ROLE postgres_ro_group;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO postgres_ro_group;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO postgres_ro_group;
View docker-move-data.MD

Stop docker

sudo service docker stop

Add docker config

Create /etc/docker/daemon.json

{ 
   "graph": "/path/to/your/docker" 
}
View Create iOS Icons.jsx
// Photoshop Script to Create iPhone Icons from iTunesArtwork
//
// WARNING!!! In the rare case that there are name collisions, this script will
// overwrite (delete perminently) files in the same folder in which the selected
// iTunesArtwork file is located. Therefore, to be safe, before running the
// script, it's best to make sure the selected iTuensArtwork file is the only
// file in its containing folder.
//
// Copyright (c) 2010 Matt Di Pasquale
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com