Skip to content

Instantly share code, notes, and snippets.

View AshKyd's full-sized avatar
🐳
a frood who really knows where his towel is

Ash Kyd AshKyd

🐳
a frood who really knows where his towel is
View GitHub Profile
@AshKyd
AshKyd / go.sh
Last active August 29, 2015 14:15
Silverstripe with sqlite3 dev environment on Fedora (PHP 5.4+)
# Fedora-specific PHP environment setup
yum install php php-mbstring php-mysql php-gd
# Manually install composer via https://getcomposer.org/download/
# Install Silverstripe & sqlite driver
composer create-project silverstripe/installer ./ 3.1.10
composer require silverstripe/sqlite3 1.3.*@dev
# Launch the dev PHP server
@AshKyd
AshKyd / diff.py
Last active August 29, 2015 14:22
Nathan Hoad's git diff with meld script.
#!/usr/bin/python
# https://nathanhoad.net/how-to-meld-for-git-diffs-in-ubuntu-hardy
import sys
import os
os.system('meld "%s" "%s"' % (sys.argv[2], sys.argv[5]))
@AshKyd
AshKyd / random.js
Created August 17, 2015 23:03
Tiny seeded pseudorandom number generator.
function random(seed) {
var x = Math.sin(seed) * 10000;
return x - Math.floor(x);
}
var mySeed = 1234;
for(var i=0; i<10; i++){
console.log(random(mySeed++));
}
@AshKyd
AshKyd / README.md
Last active September 22, 2015 19:39
NPM-based project workflow

Had enough of Grunt and Gulp because they're difficult to configure and especially difficult to debug.

After a discussion with some BrisJS peers last month I've come up with a bunch of NPM scripts to do a bunch of common browserify+uglify+misc stuff. This is based around my own workflow and doesn't cover all the bases so ymmv, but it's been working for me for a while now so I figured I'd share.

Getting started

// npm install wait-until --save-dev
waitUntil()
.interval(10)
.times(1000)
.condition(function(){
})
.done(function(){
});
@AshKyd
AshKyd / southport-line.json
Last active May 25, 2016 11:29
Rough path of the old Southport railway line. Queensland, Australia
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
var arbitraryHeight = 100000; // number of pixels of screen to load
var previousHeight, previousArticles;
document.body.style.opacity = 0;
var scrollTimeout;
var loadLoop = setInterval(() => {
var articles = Array.from(document.querySelectorAll('article'));
// how many pixels of screen have we loaded?
var loadedHeight = parseInt(window.getComputedStyle(document.querySelector('section')).height);
// If we've hit our targeted amount, stop looping & sort our images.
@AshKyd
AshKyd / go.js
Last active October 2, 2016 15:58
Extract colours from Adobe Colour Wheel https://color.adobe.com/create/color-wheel
// Extract colours from Adobe Colour Wheel https://color.adobe.com/create/color-wheel
Array.from(document.querySelectorAll('[data-mode="hex"] input')).map(input => '#'+input.value).join('\n');
zoScTQ1s3LvZ9saRQaYr1YvYvHiga0obMkDPz49UkGWhpW6ZOqbm6i6gK6TBOJT
@AshKyd
AshKyd / install.md
Last active April 6, 2017 13:15
set up mastodon
  1. Install CentOS
  2. Install Docker
  3. Install docker-compose
  4. Clone Mastodon repo
  5. Setup env
  6. Follow instructions on mastodon readme
  7. Set up let's encrypt
  8. Set up nginx with the mastodon config