Skip to content

Instantly share code, notes, and snippets.

View lewiscowper's full-sized avatar
💻
Doing my best

Lewis Cowper lewiscowper

💻
Doing my best
View GitHub Profile
@lewiscowper
lewiscowper / README
Created December 5, 2022 23:03 — forked from jmatsushita/README
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
# Inspired by https://github.com/malob/nixpkgs I highly recommend looking at malob's repo for a more thorough configuration
#
# Some people are coming directly to this Gist from search results and not the original post[1]. If that sounds like you, you should also know there is a video[2] that accompanies this.
#
# [1] https://discourse.nixos.org/t/simple-workable-config-for-m1-macbook-pro-monterey-12-0-1-with-nix-flakes-nix-darwin-and-home-manager/16834
# [2] https://www.youtube.com/watch?v=KJgN0lnA5mk
#
describe('the foo variable', function () {
it('should be defined', function () {
expect(_scope.foo).toBeDefined();
});
it('should be set correctly', function () {
expect(_scope.foo).toEqual(3);
});
});
it('should set _scope.foo to 3', function () {
expect(_scope.foo).toEqual(3);
});
it('should set _scope.baz to true', function () {
expect(_scope.baz).toBe(true);
});
describe('when the bar function is called', function () {
beforeEach(function () {
_scope.bar();
});
it('should have called the foo function from the service', function () {
expect(service.foo).toHaveBeenCalled();
});
describe('when the foo promise resolves', function () {
it('should call service.foo', function () {
service.foo();
expect(service.foo).toHaveBeenCalled();
service.deferredFoo.resolve();
_scope.$digest();
});
describe('on load', function () {
describe('the foo variable', function () {
it('should be defined', function () {
expect(_scope.foo).toBeDefined();
});
it('should be set correctly', function () {
expect(_scope.foo).toBe(false);
});
});
it('checking scope values', function () {
expect(_scope.foo).toBe(false);
expect(_scope.bar).toBe(true);
expect(_scope.qux()).toBe(false);
expect(_scope.baz.quux[0].fred).toBe(true);
});
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfLineStatus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org
/2001/XMLSchema" xmlns="http://webservices.lul.co.uk/">
<LineStatus ID="0" StatusDetails="No service between Paddington and Queen's Park while we fix a faulty
train at Warwick Avenue. SEVERE DELAYS on the rest of the line. London Underground tickets will be accepted
on London Overground and local buses.">
<BranchDisruptions>
<BranchDisruption>
<StationTo ID="183" Name="Queen's Park" />
<StationFrom ID="173" Name="Paddington" />
@lewiscowper
lewiscowper / gist:c68b9830d2ad9c8c5c0c
Last active August 29, 2015 14:17
I know this is wrong, but is it closer?
var DisruptionBox = React.createClass({
loadDisruptionsFromServer: function() {
$.ajax({
url: this.props.url,
dataType: 'xml',
method: 'GET',
success: function(xmlResponse) {
console.log(xmlResponse);
var data = $('item', xmlResponse).map(function () {
{

#How I went from forklift driver to developer in 9 months.

##Description

Moving up the ladder from forklift driver and general labourer, to front end developer, with a stint in manual testing, was a big challenge. However it’s exactly what I did, and I couldn’t have done it without following a few core principles.

Getting up the nerve to go to local usergroups, and conferences, and discovering a new found love of public speaking, was a huge leap from labouring. Similarly, I discovered contributing to open source wasn’t that big a deal, and some things certain projects did made it really easy! Also, learning about things like source control was super integral to being where I am today.

The most important part was trying to learn something from everyone I met. It didn’t matter where I met you, if I saw an opportunity to learn more, or try a new thing, I was there.