Skip to content

Instantly share code, notes, and snippets.

@tiaplagata
tiaplagata / basic_wc_func.py
Last active November 7, 2021 23:57
function to generate a word cloud from text
#Define a list of stop words
stopwords = ['private', 'tour', 'transfer', 'guide', 'skip', 'line',
'skiptheline', 'vice', 'versa']
#A function to generate the word cloud from text
def generate_basic_wordcloud(data, title):
cloud = WordCloud(width=400,
height=330,
max_words=150,
colormap='tab20c',
# Store our document term matrix data for Rome
data = dtm.transpose()['Rome, Italy'].sort_values(ascending=False)
# Generate the word cloud from frequencies
wc = WordCloud().generate_from_frequencies(data)
plt.imshow(wc)
plt.axis('off')
plt.show()
@tiaplagata
tiaplagata / basic_wordcloud.py
Last active November 7, 2021 23:57
creating a basic word cloud from text corpus
#Give our Rome corpus a variable name
rome_corpus = df.lemmatized[10]
#Instantiate wordcloud object and use method to feed it our corpus
wc = WordCloud().generate_from_text(rome_corpus)
#Use matplotlib.pyplot to display the fitted wordcloud
#Turn axis off to get rid of axis numbers
plt.imshow(wc)
plt.axis('off')
@tiaplagata
tiaplagata / wordcloud_imports.py
Last active November 7, 2021 23:56
imports needed for word clouds
from wordcloud import WordCloud, ImageColorGenerator
from PIL import Image
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
@malarkey
malarkey / Contract Killer 3.md
Last active May 24, 2024 23:38
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@xtian
xtian / html5boilerplate.jade
Last active December 23, 2023 15:05
HTML5 Boilerplate in jade
!!! 5
html(class='no-js')
head
meta(charset='utf-8')
meta(http-equiv='X-UA-Compatible', content='IE=edge')
title
meta(name='description', content='')
meta(name='viewport', content='width=device-width, initial-scale=1')