Skip to content

Instantly share code, notes, and snippets.

View supasympa's full-sized avatar
🎧
💻⌨️🖥 @barclaytweets

Lewis Barclay supasympa

🎧
💻⌨️🖥 @barclaytweets
  • Supa Sympa Ltd
  • London
View GitHub Profile
@supasympa
supasympa / osxHiddenfiles
Created July 5, 2014 13:46
enable disabled hidden files in finder ...
Run the following command to show hidden files:
defaults write com.apple.finder AppleShowAllFiles TRUE;killall Finder
Run the following command to hide hidden files:
defaults write com.apple.finder AppleShowAllFiles FALSE;killall Finder
@supasympa
supasympa / AngularJS mocking resource dependencies in tests
Created July 11, 2014 10:35
An example of hot to mock reource dependencies in tests as see in the video: AngularJS mocking resource dependencies in tests
beforeEach(function () {
mockAccessTokenResource = jasmine.stub();//stub of resource
module(function ($provide) {
$provide.value('AccessToken', mockAccessTokenResource);
})
});
/**
* gets the number of milliseconds from a date using a date format.
* @param dateString : the date to convert
* @param format : the format the date is in
* @returns Milliseconds from 01/01/1970
*/
return function (dateString, format){
function getDatePart(part){
var re, start, end;
@supasympa
supasympa / javascript & angular test
Last active December 11, 2015 10:44
Simple Javascript and Angular test for developers
JAVASCRIPT - around 60 mins to complete:
/* code */
var wordsCollection = [];
var sentence = 'A sentence of words that we\'d like to seperate';
var position = 0;
function splitSentence(s, i){
var parts;
@supasympa
supasympa / responsive-vs-adaptive.md
Created December 23, 2015 07:12
Responsive vs Adaptive web design

Responsive vs adaptive

Responsive design works on the principle of flexibility - a single fluid website that can look good on any device. Responsive websites use media queries, flexible grids, and responsive images to create a user experience that flexes and changes based on a multitude of factors.

Adaptive design is more like the modern definition of progressive enhancement. Instead of one flexible design, adaptive design detects the device and other features, and then provides the appropriate feature and layout based on a predefined set of viewport sizes and other characteristics

From this article

@supasympa
supasympa / download-web-page-locally.sh
Created February 13, 2016 12:21
Download a web page locally
wget http://mywebsite.co.uk -e robots=off -H -p -k
833c36099b7a78a29455de9bf9fde731e653347d
@supasympa
supasympa / open-social-software-engineering
Last active September 14, 2016 19:59
open-social-software-engineering
#Open, social, software engineering in risk averse environments
*Lewis Barclay, April 2016*
> Open source software is about freedom and choice, but freedom and choice introduce risk
> **- (Gartner, June 2011)**
@supasympa
supasympa / i-spy.js
Last active May 28, 2016 14:05
Quick test spy function.
;(function IIFE(global){
function noop(){}
return function iSpyCreator(prevs, id){
prevs = prevs || {}
id = id || Date.now().toString()
prevs[id] = prevs[id] || {}
@supasympa
supasympa / learning-vim--notes.md
Last active January 23, 2017 07:48
Learning Vim - notes

Learning Vim

Modes

  1. Command mode
  2. Insert mode

Tutorial

$ vimtutor