Skip to content

Instantly share code, notes, and snippets.

View danimality's full-sized avatar

Dan Wheatley danimality

  • Tassomai
  • London
View GitHub Profile
@bobpace
bobpace / event-stream.js
Created March 18, 2015 23:35
Koa.js server sent events with Rx Observables
module.exports = function eventStream() {
return function *(next) {
this.req.setTimeout(0); //no timeout
this.type ='text/event-stream; charset=utf-8';
this.set('Cache-Control', 'no-cache');
this.set('Connection', 'keep-alive');
this.set('Transfer-Encoding', 'chunked');
yield* next;
}
@robwormald
robwormald / app.ts
Last active May 29, 2016 01:49
angular2 + rx + ts
import {Component, View, bootstrap, CORE_DIRECTIVES, ON_PUSH, LifecycleEvent, ElementRef} from 'angular2/angular2';
import {NgFormModel, NgControl,FormBuilder, FORM_BINDINGS, FORM_DIRECTIVES} from 'angular2/forms'
import {RxPipe} from './rxPipe'
import {Observable} from 'rx.all'
@Component({
selector: 'hello',
lifecycle: ON_PUSH
})
@pixelbacon
pixelbacon / squarespaceBreakpoints.less
Last active January 24, 2024 09:32
Squarespace Breakpoints.
/**
Squarespace essentially doesn't really document their breakpoints.
This can be quite annoying to not have when doing custom CSS.
Most themes use essentially one breakpoint. Mobile and not mobile; anything 750 and below is considered mobile.
You can use these to write your own CSS and simply use the "Style Editor" to inject your compiled CSS in the event
you are not using "Developer Mode" in your site.
Enjoy!
@justinpawela
justinpawela / config
Created August 3, 2016 01:39
AWS CodeCommit Multiple Account Config
# This file is: ~/.ssh/config
# You may have other (non-CodeCommit) SSH credentials stored in this
# config file – in addition to the CodeCommit settings shown below.
# NOTE: Make sure to run [ chmod 600 ~/.ssh/config ] after creating this file!
# Credentials for Account1
Host awscc-account1 # 'awscc-account1' is a name you pick
Hostname git-codecommit.us-east-1.amazonaws.com # This points to CodeCommit in the 'US East' region
@cdechery
cdechery / envinspect.config
Created May 16, 2018 19:04
Retreive Beanstalk Application name from within EC2 instance
packages:
yum:
jq: []
container_commands:
01-getenv-info:
command: |
ENV_ID=`{"Ref": "AWSEBEnvironmentId" }`
ENV_NAME=`{"Ref": "AWSEBEnvironmentName" }`
echo "env.id="$ENV_ID > /tmp/awseb.properties