Skip to content

Instantly share code, notes, and snippets.

Avatar
🗂️
🧹 Tidying up

Adam Garrett-Harris agarrharr

🗂️
🧹 Tidying up
View GitHub Profile
@agarrharr
agarrharr / gist:281dd9e650367906e1b555b3b17b35ad
Created May 29, 2020
Create Video From Image and mp3 Audio File
View gist:281dd9e650367906e1b555b3b17b35ad
ffmpeg -loop 1 -i ~/Downloads/bookbytes-video-image.png -i ~/Downloads/bb-032.mp3 -c:v libx264 -tune stillimage -c:a aac -b:a 192k -pix_fmt yuv420p -shortest ~/Downloads/bb-032.mp4
View comments.md
- /*
- console.log('commented')
- /**/
+ //*
+ console.log('uncommented')
+ /**/
View keebase.md

Keybase proof

I hereby claim:

  • I am agarrharr on github.
  • I am agarrharr (https://keybase.io/agarrharr) on keybase.
  • I have a public key ASAHqzkxr1n0N1OgZ8ft27nVSNVj7OoAYLPMKei5I7vKxAo

To claim this, I am signing this object:

@agarrharr
agarrharr / index.md
Last active Sep 18, 2020
Common Ledger CLI Commands
View index.md

Common Ledger CLI Commands

  • Income vs expenses this month?

    $ ledger balance income expenses --period "this month"
  • What did my budget look like at a certain date?

@agarrharr
agarrharr / index.md
Last active Oct 11, 2017
React/Redux Code Style
View index.md

React/Redux Code Style

Redux

General

  • Store the minimum amount of data necessary to describe the entire state of the app
  • Use selectors to derive information from the store

Directory Structure

@agarrharr
agarrharr / index.md
Last active Feb 18, 2020
Getting Started with Redux by Dan Abramov Notes
View index.md

Redux Course

https://egghead.io/courses/getting-started-with-redux

Principles

  1. Single source of truth
    • Describe the state of the entire app in the state
  2. State is read-only
    • The state tree is redundant. You cannot modify it. Everytime you want to change the state, you dispatch an action.
@agarrharr
agarrharr / index.html
Last active Aug 29, 2015
Reorder the Dom II
View index.html
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<svg height="500px" width="500px">
<circle cx="100" cy="100" r="50" style="fill: #0091EA"></circle>
<circle cx="150" cy="100" r="50" style="fill: #00C853"></circle>
</svg>
<script>
@agarrharr
agarrharr / index.html
Last active Aug 29, 2015
Reorder the Dom
View index.html
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<svg height="200px" width="200px">
<circle cx="100" cy="100" r="50" style="fill: #0091EA"></circle>
<circle cx="150" cy="100" r="50" style="fill: #00C853"></circle>
</svg>
<script>
View d3.chart.min.js
/*! d3.chart - v0.2.1
* License: MIT Expat
* Date: 2014-06-24
*/
(function(t){"use strict";function e(t){var e,r,n,i;if(!t)return t;for(r=arguments.length,e=1;r>e;e++)if(n=arguments[e])for(i in n)t[i]=n[i];return t}var r=t.d3,n=Object.hasOwnProperty,i=function(t,e){if(!t)throw Error("[d3.chart] "+e)};i(r,"d3.js is required"),i("string"==typeof r.version&&r.version.match(/^3/),"d3.js version 3 is required");var a=/^(enter|update|merge|exit)(:transition)?$/,s=function(t){i(t,"Layers must be initialized with a base."),this._base=t,this._handlers={}};s.prototype.dataBind=function(){i(!1,"Layers must specify a `dataBind` method.")},s.prototype.insert=function(){i(!1,"Layers must specify an `insert` method.")},s.prototype.on=function(t,e,r){return r=r||{},i(a.test(t),"Unrecognized lifecycle event name specified to `Layer#on`: '"+t+"'."),t in this._handlers||(this._handlers[t]=[]),this._handlers[t].push({callback:e,chart:r.chart||null}),this._base},s.prototype.off=function(t,e){var r,n=this._handlers[t];if(i(a.
@agarrharr
agarrharr / feed.xml
Created Feb 27, 2015
Jekyll Rss Feed
View feed.xml
---
---
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ site.title }}</title>
<description>{{ site.description }}</description>
<link>{{ site.url }}</link>
<atom:link href="{{ site.url }}/feed.xml" rel="self" type="application/rss+xml" />
{% for post in site.posts limit:10 %}
You can’t perform that action at this time.