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
*** Cluster Setup for Google Container Engine *** | |
0/ Install and configure local gcloud and kubectl: https://cloud.google.com/sdk/docs/ | |
> gcloud components install kubectl | |
1/ Configure Google Cloud account: | |
> gcloud config set account YOUR_EMAIL_ADDRESS | |
> gcloud config set project YOUR_PROJECT_ID | |
> gcloud config set compute/zone us-west1-a | |
> gcloud config set container/cluster example |
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 os.path | |
import pandas as pd | |
from bokeh.core.properties import value | |
from bokeh.io import show, output_file, output_notebook | |
from bokeh.plotting import figure | |
output_notebook() | |
def plot_state_incidents(data): | |
year_names = [str(x) for x in data['year'].values.tolist()] | |
years = year_names |
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
do shell script "~/some_script.py" |
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
const downloadCSV = csv_data => { | |
const hidden_element = document.createElement("a"); | |
const uri_encoded = encodeURI(csv_data); | |
hidden_element.href = `data:text/csv;charset=utf8,${uri_encoded}`; | |
hidden_element.target = "_blank"; | |
hidden_element.download = "storypins.csv"; | |
hidden_element.click(); | |
}; |
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
mkdir /etc/nginx/ssl | |
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt |
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
#!/usr/bin/env bash | |
rm -fr story-tools | |
rm -fr story-tools-composer | |
git clone https://github.com/MapStory/story-tools | |
git clone https://github.com/MapStory/story-tools-composer | |
# Setup story-tools | |
cd story-tools && \ | |
git checkout composer && \ | |
yarn install && \ |
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 save(self, *args, **kwargs): | |
if not self.slug: | |
# Ensure uniqueness: | |
slug = slugify(self.name) | |
if not App.objects.filter(slug=slug).exists(): | |
self.slug = slug | |
else: | |
count = 1 | |
while App.objects.filter(slug=slug).exists(): | |
count += 1 |
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
/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */ | |
/* Document | |
========================================================================== */ | |
/** | |
* 1. Correct the line height in all browsers. | |
* 2. Prevent adjustments of font size after orientation changes in | |
* IE on Windows Phone and in iOS. | |
*/ |
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
{% load static %} | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> | |
{# <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.4.1/css/bulma.min.css">#} | |
<link rel="stylesheet" href="{% static 'normalize.css' %}"> |
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 url('https://fonts.googleapis.com/css?family=Lato'); | |
* { | |
box-sizing: border-box; // Prevent borders from being larger thanks to padding and margins. | |
} | |
body { | |
line-height: 1.6; | |
color: #3a3a3a; |
NewerOlder