sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
libfreetype6-dev \
libpng12-dev \
libzmq3-dev \
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 Sequelize = require('sequelize') | |
var db = new Sequelize('mydb', null, null, { | |
dialect: 'postgres' | |
}) | |
var Post = db.define('post', { | |
id: { | |
type: Sequelize.INTEGER, | |
primaryKey: true, | |
autoIncrement: true |
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 User from './User' | |
import Session from './Session' | |
/* Associations */ | |
User.hasMany(Session) | |
/* Hooks */ | |
User.afterDestroy(async (user, options) => { | |
await Session.destroy({ | |
where: { userId: user.id }, |
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 expect = require('chai').expect; | |
var Sequelize = require('sequelize'); | |
var db = new Sequelize('postgres://localhost/amazon_db'); | |
var User = db.define('user', { | |
name: { | |
type: Sequelize.STRING, | |
allowNull: false | |
}, | |
foo: { |
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
namespace project | |
{ | |
// ... | |
public class AccountsController : Controller { | |
// ... | |
[HttpGet, Route("accounts/manage/change-passwords", Name="change-password")] | |
[Authorize(Roles="Admin")] |
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 { GraphQLSchema, GraphQLObjectType } from 'graphql'; | |
import { nodeField, nodesField } from './types/Node'; | |
import StoryType from './types/StoryType'; | |
import UserType from './types/UserType'; | |
import StoryMutations from './mutations/StoryMutations'; | |
import CommentMutations from './mutations/CommentMutations'; | |
export default new GraphQLSchema({ | |
query: new GraphQLObjectType({ |
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
## Ignore Visual Studio temporary files, build results, and | |
## files generated by popular Visual Studio add-ons. | |
## | |
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore | |
# User-specific files | |
*.suo | |
*.user | |
*.userosscache | |
*.sln.docstates |
I hereby claim:
- I am skynode on github.
- I am skynode (https://keybase.io/skynode) on keybase.
- I have a public key ASBoSMtTabQZR_8psQIWjT63BD3vxAkkXFViS9ZpmV4WJAo
To claim this, I am signing this object:
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
// Async/Await requirements: Latest Chrome/FF browser or Babel: https://babeljs.io/docs/plugins/transform-async-to-generator/ | |
// Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill: https://github.com/github/fetch | |
// async function | |
async function fetchAsync () { | |
// await response of fetch call | |
let response = await fetch('https://api.github.com'); | |
// only proceed once promise is resolved | |
let data = await response.json(); | |
// only proceed once second promise is resolved |
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
using System; | |
using System.Net.Http; | |
using System.Net.Http.Formatting; | |
using System.Threading.Tasks; | |
namespace MyProject.Extensions | |
{ | |
public static class HttpClientEx | |
{ | |
public const string MimeJson = "application/json"; |