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
/* Removes items from the left-hand menu */ | |
div[aria-label="Top Tweets off"], | |
[data-testid="AppTabBar_Explore_Link"], | |
a[href="/i/bookmarks"], | |
a[href$="/communities"], | |
[data-testid="AppTabBar_More_Menu"], | |
[data-testid="SideNav_NewTweet_Button"], | |
[data-testid="sidebarColumn"], /* right-hand "explore" column */ | |
[data-testid="DMDrawer"], /* Messages drawer */ |
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 React, { useState } from 'react'; | |
function App() { | |
const [checked, setChecked] = useState(false); | |
const [consent, setConsent] = useState(''); | |
return ( | |
<div className="App"> | |
<form> | |
<h1>Add new client</h1> |
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
''' | |
Taken from: | |
http://stackoverflow.com/users/1074592/fakerainbrigand | |
http://stackoverflow.com/questions/15401815/python-simplehttpserver | |
''' | |
import sys | |
import os | |
if sys.version_info < (3,): | |
import SimpleHTTPServer as server |
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
<TextSymbolizer> | |
<Geometry> | |
<ogc:Function name="centroid"> | |
<ogc:PropertyName>the_geom</ogc:PropertyName> | |
</ogc:Function> | |
</Geometry> | |
<Label> | |
<ogc:PropertyName>nr</ogc:PropertyName> | |
</Label> | |
<Font> |
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 sys | |
import codepoints | |
points = ( | |
'\U0001F004', | |
'\U0001F0CF', | |
'\U0001F170-\U0001F171', | |
'\U0001F17E', | |
'\U0001F17F', | |
'\U0001F18E', |
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
#!/bin/bash | |
cd docs | |
rm -rf dddocs | |
rm -rf docs-build | |
mkdir docs-build | |
npm install | |
npm run build | |
git clone -b gh-pages --single-branch git@github.com:[YOUR ORG]/[YOUR REPOSITORY].git dddocs |
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 ResourceObjectRelatedField(serializers.RelatedField): | |
def to_internal_value(self, data): | |
return super(ResourceObjectRelatedField, self).to_internal_value(data) | |
def to_representation(self, value): | |
if isinstance(value, Organization): | |
serializer = OrganizationSerializer( | |
value, | |
fields=('id', 'name', 'slug')) | |
else: |
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 ResourceObjectRelatedField(serializers.RelatedField): | |
def to_internal_value(self, data): | |
return super(ResourceObjectRelatedField, self).to_internal_value(data) | |
def to_representation(self, value): | |
if isinstance(value, Organization): | |
serializer = OrganizationSerializer(value) | |
else: | |
raise Exception('Unexpected related 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
class ProjectSerializer(DetailSerializer, ModelSerializer): | |
users = UserSerializer(many=True, read_only=True) | |
organization = OrganizationSerializer(read_only=True) | |
class Meta: | |
model = Project | |
fields = ('id', 'organization', 'country', 'name', 'description', | |
'archived', 'urls', 'contacts', 'users') | |
read_only_fields = ('id', 'country',) | |
detail_only_fields = ('users',) |
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 React from 'react'; | |
import classNames from 'classnames'; | |
const propTypes = { | |
messageDismiss: React.PropTypes.func, | |
message: React.PropTypes.object.isRequired, | |
}; | |
class Message extends React.Component { | |
constructor(props) { |
NewerOlder