Skip to content

Instantly share code, notes, and snippets.

@spdustin
spdustin / index.html
Created September 27, 2024 17:52
Untitled
<dash-e-card>
<dash-e-icon>
<img src="https://ha.spdustin.com/local/dash-e-card/svg-filled/clear-day.svg">
</dash-e-icon>
<dash-e-temp>
70º
</dash-e-temp>
<dash-e-warnings>
</dash-e-warnings>
<dash-e-clock>
trump = load_tweets_from_mongodb(dbname='TrumpTweets')
obama = load_tweets_from_mongodb(dbname='ObamaTweets')
def load_tweets_from_mongodb(dbname, collection='tweet'):
df = odo('mongodb://localhost/{}::{}'.format(dbname, collection),
pd.DataFrame)
df.drop(['user_id', 'usernameTweet', 'url'], axis=1, inplace=True)
df = df.replace(0, np.NAN)
df.dropna(how='any', inplace=True)
df['reply_to_retweet_ratio'] = np.divide(df['nbr_reply'],
df['nbr_retweet'])
df['reply_to_like_ratio'] = np.divide(df['nbr_reply'],
df['nbr_favorite'])
@spdustin
spdustin / refugee.md
Created February 18, 2017 23:54
Arnessa (@Rrrrnessa): How I Became a Refugee

FROM TWEETS STARTING HERE: HTTPS://TWITTER.COM/RRRRNESSA/STATUS/667019978550317056

I am going to tell you guys the process of how I became an refugee admitted to the United States of American and how long it actually is. But I'd like you to keep in mind that the process to admit Syrian refugees to the U.S.A is even more complex.

Okay so first things first you apply for refugee status with a U.N agency. The application process isn't just a piece of paper. You have to submit ALL your documents. Birth certificates, report cards from school, IDs, driver licenses, passports, old utility bills. If you're displaced, you have to provide proof that you are displaced. That your house was bombed/burned or that there are squatters in it.

You have to write down your story. All your family members do. Where you were born, where you are now, what you're doing, everything.

You have to provide them with names of ALL your family members, dead and alive. All your friends, neighbors, teachers. Everyone. You have to provide t

@spdustin
spdustin / keybase.md
Created February 11, 2017 19:03
keybase.md

Keybase proof

I hereby claim:

  • I am spdustin on github.
  • I am spdustin (https://keybase.io/spdustin) on keybase.
  • I have a public key whose fingerprint is 9B35 3773 83BE E600 AEAA 8601 95B3 F539 33A5 D864

To claim this, I am signing this object:

@spdustin
spdustin / baselineSPListRequest.js
Last active July 18, 2016 23:30
Sample (and verbose) boilerplate for accessing SharePoint list data
/**
* Note: This example is _purposefully verbose_, for ease of reading.
*
* In an ideal world, your generic function would return the list items, and
* another function would actually be enqueued in the SOD call that calls
* (in IE9) just Array.forEach() through them for one-by-one processing,
* for example. Hope this helps!
*/
// This function will console.log items from the list you specify in the
@spdustin
spdustin / README.md
Last active July 15, 2016 06:42
HN Styles

HN Styles

Just some simple CSS styles for Hacker News that I use to keep the default look and feel, but improve usability a bit.

@spdustin
spdustin / demo.scss
Created March 22, 2016 20:05
demo.scss
$bgColor: #DEDBEE;
%clear {
*zoom: 1;
&:before, &:after {
content: ' ';
display: table;
}
&:after {
clear: both;
@spdustin
spdustin / cars.xsl
Last active March 1, 2016 17:35
cars.xsl
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" />
<xsl:template match="/">
<table>
<thead>
<tr>
<th>Year</th>
<th>Make</th>
<th>Model</th>
</tr>