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 Ember from 'ember'; | |
import { schema } from '../models/user'; | |
import Validations from '../validations/user'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
Validations, | |
changesets: {}, | |
allValid(changeArray) { |
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 Ember from 'ember'; | |
import { schema } from '../models/user'; | |
import Validations from '../validations/user'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
Validations, | |
changesets: {}, | |
allValid(changeArray) { |
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
from ply import lex | |
class BooleanMatchError(Exception): | |
pass | |
reserved = {'AND': 'AND', 'OR': 'OR'} | |
math_tokens = [ |
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
""" | |
Given a dictionary, transform it to a string. Then byte encode that string. Then base64 encode it and since this will go | |
on a url, use the urlsafe version. Then decode the byte string so that it can be else where. | |
""" | |
data = base64.urlsafe_b64encode(json.dumps({'a': 123}).encode()).decode() | |
# And the decode is just as simple... | |
data = json.loads(base64.urlsafe_b64decode(query_param.encode()).decode()) | |
# Byte encode the string, base64 decode that, then byte decode, finally transform it to a dictionary |
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
let store = (container) => { | |
const store = container.lookup('service:store'); | |
Ember.run(() => { | |
store.createRecord('model', { | |
modelAttr: 'one' | |
}); | |
store.createRecord('model', { | |
modelAttr: 'two' | |
}); | |
}); |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<style> | |
body { | |
margin: 0px; | |
padding: 0px; | |
} | |
</style> | |
</head> |
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
'use strict'; | |
const browsers = [ | |
'ie 11', | |
'last 1 Chrome versions', | |
'last 1 Firefox versions', | |
'last 1 Safari versions' | |
]; | |
const isCI = !!process.env.CI; |
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
aws cloudformation list-stacks --stack-status-filter REVIEW_IN_PROGRESS | jq -c '.StackSummaries[] | .StackName' | xargs -L 1 aws cloudformation delete-stack --stack-name |
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
def convert(text): | |
return "".join([x.capitalize() for x in text.split('-')]) |
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
{"openapi": "3.0.2", "info": {"version": "1.0.0", "title": "{json:api} Specification", "description": "An include file to define the [{json:api} 1.0 specification](http://jsonapi.org/format). N.B. I've got some confusion going on between a validating a jsonapi schema and defining one!\n\nThis file also provides a limited demonstration of jsonapi with path items for collections, items and their methods. You should be able to open in a modern version of [swagger-editor](https://github.com/swagger-api/swagger-editor) or [swagger-ui-watcher](https://github.com/moon0326/swagger-ui-watcher).\n\nThis file was created by downloading the [schema definition](http://jsonapi.org/schema) and then editing as needed to make it useful with the Open API Specification. It is subject to the `CC0 1.0 Universal` license as it is derived from the {json:api} specification.\n\nSeveral changes had to be made to that schema since it is non-normative and primarily only documented the results of GET operations. See especially definition |