This project was bootstrapped with Create React App.
Below you will find some information on how to perform common tasks.
You can find the most recent version of this guide here.
| // Apollo Client lets you attach GraphQL queries | |
| // to your UI components to easily load data | |
| const FeedWithData = graphql(gql`{ | |
| feed (type: TOP, limit: 200) { | |
| repository { | |
| name, owner { login } | |
| # Uncomment the line below to get stars! | |
| # stargazers_count | |
| } |
This project was bootstrapped with Create React App.
Below you will find some information on how to perform common tasks.
You can find the most recent version of this guide here.
| function onOpen() { | |
| var ui = DocumentApp.getUi(); | |
| ui.createMenu('Convert to .RST') | |
| .addItem('Convert to .RST and email me the result', 'ConvertToRestructuredText') | |
| .addToUi(); | |
| } | |
| // Adopted from https://github.com/mangini/gdocs2md by Renato Mangini | |
| // License: Apache License Version 2.0 | |
| String.prototype.repeat = String.prototype.repeat || function(num) { |
| { | |
| "building": [ | |
| "venue" | |
| ], | |
| "county": [ | |
| "postalcode", | |
| "localadmin", | |
| "locality" | |
| ], | |
| "borough": [ |
| import os | |
| import re | |
| skip_paths = ( | |
| '.git', | |
| '.DS_Store', | |
| '.bz2', | |
| ) | |
| bad_chars_re = re.compile( | |
| r'[^a-zA-Z0-9_\(\),\.\s"%\':;=@\[\]`\{\}\-!#\*\+/<>\?\$&\\\^\|~]' |
| =((A1-21600000)/86400000)+25569 | |
| # Then select the column and use Format -> Number -> Date time |
| import csv | |
| import argparse | |
| import sys | |
| def convert_cleaned_to_openelex(filepath, office='Governor'): | |
| yield ( | |
| 'county', 'precinct', 'office', 'district', | |
| 'candidate', 'party', 'votes' | |
| ) |
A Python development environment is a folder which you keep your code in, plus a "virtual environment" which lets you install additional library dependencies for that project without those polluting the rest of your laptop.
mkdir my-new-python-project
cd my-new-python-project
virtualenv --python=python2.7 venv
| # First, attach to the docker container | |
| bay attach elasticsearch | |
| # Now install tcpdump | |
| apt-get update && apt-get install tcpdump | |
| # Now run it, sniffing all traffic to port 9200 | |
| tcpdump -A -s 0 'tcp port 9200 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' |
| [ | |
| { | |
| "date": "Mon Jan 23 13:03:00 2017 -0800", | |
| "message": "Recommended by Django https://docs.djangoproject.com/en/1.10/ref/databases/#setting-sql-mode", | |
| "title": "SET sql_mode='STRICT_TRANS_TABLES';", | |
| "hash": "a395f401c9a6d3e8602b80ecc729d736da871f46", | |
| "author": "Simon Willison <simonw@example.com>" | |
| }, | |
| { | |
| "date": "Mon Jan 23 11:37:38 2017 -0800", |