Skip to content

Instantly share code, notes, and snippets.

@fatpixel
fatpixel / ubuntu-raid.sh
Created February 16, 2020 18:01 — forked from umpirsky/ubuntu-raid.sh
Install Ubuntu on RAID 0 and UEFI/GPT system
# http://askubuntu.com/questions/505446/how-to-install-ubuntu-14-04-with-raid-1-using-desktop-installer
# http://askubuntu.com/questions/660023/how-to-install-ubuntu-14-04-64-bit-with-a-dual-boot-raid-1-partition-on-an-uefi%5D
sudo -s
apt-get -y install mdadm
apt-get -y install grub-efi-amd64
sgdisk -z /dev/sda
sgdisk -z /dev/sdb
sgdisk -n 1:0:+100M -t 1:ef00 -c 1:"EFI System" /dev/sda
sgdisk -n 2:0:+8G -t 2:fd00 -c 2:"Linux RAID" /dev/sda
@fatpixel
fatpixel / Contract Killer 3.md
Created September 20, 2016 23:25
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@fatpixel
fatpixel / README.md
Created June 3, 2016 17:32 — forked from johan/README.md
JS debug breakpoint / log snippets

stopBefore.js

2min screencast

These tools inject a breakpoint, console.log or console.count in any function you want to spy on via stopBefore('Element.prototype.removeChild') or ditto stopAfter, logBefore / logAfter / logAround / logCount.

Works in Chrome DevTools and Safari Inspector; Firefox dev tools reportedly less so.

@fatpixel
fatpixel / textOnPath
Last active August 29, 2015 14:12 — forked from friendzis/textOnPath
// Based on http://stackoverflow.com/a/19122486/478725
// Text is rotated to be read begin -> end
// Variable width fonts will still be a bit off center
var angle = function(v1, v2) {
ang = Math.atan2(v2.y - v1.y, v2.x - v1.x);
return {
radians: ang,
degrees: ang * 180 / Math.PI
};
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
<?php
//preferably in some repository class (or the model itself)
// this assumes you prefix your relations consistently, ie 'public function relSomeRelation()'
/**
* @param string relation method delimiter
* @return array relationship methods
*/
public function getRelationMethods($delimiter)