⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var connectionString = 'postgres://localhost:5432/postgres'; | |
var Promise=require('bluebird'); | |
var knex = require('knex')({ | |
client: 'pg', | |
connection: { | |
user: 'postgres', | |
database: 'postgres', | |
port: 5432, |
A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."
- Does the design expect failures to happen regularly and handle them gracefully?
- Have we kept things as simple as possible?
TL;DR
Create a backup:
pg_dumpall > mybackup.sql
Perform the upgrade:
sudo pg_dropcluster 9.4 main --stop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var source = require('vinyl-source-stream'); | |
var buffer = require('vinyl-buffer'); | |
var browserify = require('browserify'); | |
var watchify = require('watchify'); | |
var babel = require('babelify'); | |
function compile(watch) { | |
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { graphql, GraphQLString, GraphQLInt } from 'graphql'; | |
import { objectType, enumType, schemaFrom, listOf } from 'graphql-schema'; | |
import request from 'promisingagent'; | |
const repositorySortEnum = enumType('RepositorySort') | |
.value('CREATED', 'created') | |
.value('UPDATED', 'updated') | |
.value('PUSHED', 'pushed') | |
.value('FULL_NAME', 'full_name') | |
.end(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Comment extends React.Component { | |
render() { | |
var {comment} = this.props; | |
var {author} = comment; | |
var savePending = this.props.relay.hasOptimisticUpdate(this.props.comment); | |
return ( | |
<div style={{opacity: savePending ? 0.4 : null}}> | |
<img src={author.avatar} width={16} /> <strong>{author.name}</strong> {comment.text} | |
{savePending && | |
<img src="data:image/gif;base64,R0lGODlhEgASAPMAADMzMw0NDUtLS21tbY+Pj6+vr83Nzf7+/vr6+vPz8+bm5gAAAAAAAAAAAAAAAAAAACH5BAAKAAAAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAAEgASAAAEjPDISauViZiDCkHXpAgDKADKhSSHMghGAZQtOBVDoRACwROZAIGCGwwMvQGgcFpSEAYjQbFyAWCsCQKhKBiyB5xCkUiACMbB8CkIBK4stPSZALgDAts24SUOqBwUOwQ6e20BBRUGPhoFXl52QjZhGlAaMV8DAQMVWR5jjiBkFzuJHQVgIQYbLawhrxURACH5BAAKAAAALAAAAAASABIAgwsLCy0tLWxsbFBQUJGRka6urs7Ozv7+/vn5+fPz8+bm5gAAAAAAAAAAAAAAAAAAAASL8Mh5EKIYo2JqIRmmDAKSDIMSHokkCIZBSso1FfA2EMSeEAHQxPAiEHkDYmBQwBgIAoIKoRAsO5SLoqCSIJ6KhMUT5WUGgfRAwuM1MegAYF2xbLsSXNg22RIKFgkyAAGAFAYfXAUFAwCMAI58TwZfHAIAJUACWTaLW4R2fFmLFpBYKwcGXTiiqF4hEQAh+Q |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias accio=wget | |
alias avadaKedavra='rm -f' | |
alias imperio=sudo | |
alias priorIncantato='echo `history |tail -n2 |head -n1` | sed "s/[0-9]* //"' | |
alias stupefy='sleep 5' | |
alias wingardiumLeviosa=mv | |
alias sonorus='set -v' | |
alias quietus='set +v' |