Skip to content

Instantly share code, notes, and snippets.

View ecridge's full-sized avatar

Eden Cridge ecridge

View GitHub Profile

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@ecridge
ecridge / python-notes.md
Last active September 1, 2017 09:56
Some personal notes on Python 3 after spending too long with ES6.

Python notes

Some personal notes on Python 3 after spending too long with ES6. YMMV.

Strings and lists

You can reverse a string or list using colon notation:

>>> s = 'This is a string.'
@ecridge
ecridge / fill-container.js
Last active October 27, 2016 17:54
p5.js sketch that fills parent element
/**
* p5.js sketch that fills its parent element.
* On my phone on a train so I haven’t actually tested…
*/
var container;
function setup() {
var canvas;
@ecridge
ecridge / link-icloud-drive.sh
Created October 2, 2016 17:47
Add a symbolic link to iCloud Drive in Bash on macOS.
@ecridge
ecridge / two_week_cal.sh
Last active September 18, 2016 23:31
Display two weeks at a time in Calendar on OS X Yosemite.
#!/usr/bin/env bash
defaults write com.apple.iCal n\ days\ of\ week 14
@ecridge
ecridge / perceptual_average.c
Last active July 31, 2016 14:39
A little tool to calculate the perceptual mean colour and lightness of an image in PPM format.
/*
* Name: Perceptual average calculator for PPM images
* Author: Joe Cridge <joe.cridge@me.com>
* URL: https://gist.github.com/joecridge/d0ecf785d8a12eaac2353e02b4d8c9b7
* License: Unlicense
* Created: 2016-07-31
* Modified: 2016-07-31
*/
#include <stdio.h>
@ecridge
ecridge / source-code-management.md
Last active October 21, 2015 17:29
SCM guide for Hackspace 2015/16.

Source Code Management

SCM is a way to keep track of changes to project source code over time and when worked on by multiple people. Git is one of the most popular version control systems, especially on Unices like GNU/Linux.

If you haven’t used Git before, Try Git is a pretty good place to start, and GitLab’s workflow video is useful too.

@ecridge
ecridge / get-problem.sh
Last active April 30, 2016 13:45
A Bash script that downloads problems from Project Euler and saves them into empty Ruby files. Requires Pandoc.
#!/usr/bin/env bash
# Download a problem from Project Euler and save it into a Ruby file.
# Usage: get-problem 42
PROBNUM=$1
PADNUM=`printf "%03d" $PROBNUM`
# Download problem page, convert to plain text, and comment out.
wget -q https://projecteuler.net/problem=$PROBNUM -O $PADNUM.html