Skip to content

Instantly share code, notes, and snippets.

View hellosteadman's full-sized avatar

Mark Steadman hellosteadman

View GitHub Profile
@hellosteadman
hellosteadman / gitlab-ci.yml
Created November 30, 2018 13:20
Podiant pipeline
variables:
K8S_CONTEXT: core
stages:
- test
- build
- migrate
- deploy
test:
@hellosteadman
hellosteadman / mindhacking.md
Created July 21, 2018 10:05
Mind Hacking workbook

Day 1: Accepting the Quest

Write "Hello World!" Then decide on a specific time and place you will practice mind hacking each day, and keep the practice sheet in that spot as a visual reminder.

Day 2: What Was My Mind Just Thinking?

Start building up awareness of your mind by asking yourself, as frequently as possible, "What was my mind just thinking?" Keep track of how many times you remember to "check in" on your mind today.

Day 3: Squirrel!

For the rest of the day, try to become aware of whenever your attention is pulled away from the task at hand by either digital or human interruptions. Try to become aware of the feeling of "broken flow" when you lose your concentration. Keep track of how many interruptions you notice, and write down your total score.

Day 4: The One-Hour Investment

@hellosteadman
hellosteadman / README.md
Created March 9, 2018 14:26
Adding server-side validation support to ember-bootstrap-cp-validations

I spent a day trying to figure out how to get ember-bootstrap to handle server-side (HTTP 422) validation errors. I tried the three supported validation packages (two of which don't work with the newest version of Ember.js), and finally began to understand that ember-cp-validations has nothing to do with server-side errors.

So, taking inspiration from ember-bootstrap-ds-error-validations, which causes errors when combined with another validation package, I was able to put something fairly simple in place.

I'll be honest, I don't entirely know what the app/components/bs-form.js file is doing (this was taken from ember-bootstrap-cp-validations I think), but that, combined with app/components/bs-form/element.js, which takes the server-side messages and places them in the customError property (as a computed property), I get a combination of client- and server-side validation that works. At least for me.

Verifying that "iamsteadman.id" is my Blockstack ID. https://onename.com/iamsteadman
@hellosteadman
hellosteadman / bookmarklet.js
Created February 3, 2016 22:22
Acast embed bookmarklet
(
function() {
var found = false;
Array.prototype.forEach.call(
document.querySelectorAll('.player-embedded-v2 iframe'),
function(iframe, index) {
var src = iframe.getAttribute('src');
var width = 640;
var height = 80;
@hellosteadman
hellosteadman / sidebar.js
Created August 14, 2015 22:55
Smooth floating sidebar
jQuery(document).ready( function() { / ... All my other theme setup calls ... /
var topbar = jQuery('#wpadminbar').size() > 0 ? jQuery('#wpadminbar').height() : 0;
var sidebar = jQuery('#sidebars');
var startOffset = sidebar.parent().offset().top;
var offsetY = parseInt(sidebar.parent().css('padding-top'));
var offsetX = sidebar.position().left + sidebar.parent().position().left;
jQuery(window).scroll(
function() {
sidebar.stop();
@hellosteadman
hellosteadman / ffmpeg.yaml
Created June 30, 2015 09:02
An Ansible playbook include for installing ffmpeg on Ubuntu
---
- name: Install yasm
shell: 'chdir=/tmp {{ item }} creates=/usr/local/bin/yasm'
with_items:
- wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
- tar xzvf yasm-1.2.0.tar.gz
- cd yasm-1.2.0; ./configure && make && make install && make distclean
- name: Install x264
@hellosteadman
hellosteadman / breakout.js
Last active August 29, 2015 14:06
Make images break out of their containers, responsively
// I'm using a Ghost theme and I wanted a way for certain images to break out of their container, but
// still work responsively. I wrote a JavaScript kludge to do just that. It makes specific images
// full-width, then calculates the height the image needs, if it's to retain the same aspect ratio.
// We absolutely-position the image to the left, which means all the content that follows will be
// out of whack, so we create a div that adds empty (invisible) space between the top of the image
// and the next element. We run this every time the browser resizes, and voila... sort of.
// I added this JavaScript to the end of my blog theme's <script> tags and it works. That's about
// all I can say!
@hellosteadman
hellosteadman / bbpress-to-phpbb.sql
Last active January 10, 2022 14:11
Convert newer-style bbPress forums (where content is stored as WordPress posts) to phpBB. Based on code by primehifi (http://mark.tl/1l9HyRR)
/* If anything goes wrong, let's not muck up the database */
START TRANSACTION;
/* Clear tables and reset IDs */
TRUNCATE TABLE phpbb_forums;
TRUNCATE TABLE phpbb_topics;
TRUNCATE TABLE phpbb_topics_posted;
TRUNCATE TABLE phpbb_topics_track;
TRUNCATE TABLE phpbb_posts;
DELETE FROM phpbb_acl_groups WHERE forum_id > 0;
@hellosteadman
hellosteadman / twopy.py
Created March 4, 2014 09:59
Add your Twitter friends' RSS feeds to a single OPML file
"""
This script requires the following Packages
1: Twitter: https://pypi.python.org/pypi/twitter
2: PyQuery: https://pypi.python.org/pypi/pyquery
3: Jinja2: https://pypi.python.org/pypi/Jinja2
It's fairly primitive but works. It uses a Jinja2 template to create an OPML
file from the RSS feeds of the websites run by the people you follow on
Twitter.