Skip to content

Instantly share code, notes, and snippets.

@kbarre123
kbarre123 / keybase.md
Created May 26, 2015 20:21
keybase.md

Keybase proof

I hereby claim:

  • I am kbarre123 on github.
  • I am kbarre123 (https://keybase.io/kbarre123) on keybase.
  • I have a public key whose fingerprint is 2EC5 BD3F 8817 95F7 B155 DA47 7E85 46B9 EE67 58CA

To claim this, I am signing this object:

@kbarre123
kbarre123 / plotly_temp_analysis.py
Last active August 29, 2015 14:17
Generate a graph using Plot.ly
'''
Generate a Plot.ly graph (http://plot.ly) from data collected from an Arduino and DS18B20 temperature
sensor. # Learn about API authentication here: https://plot.ly/python/getting-started and find your api_key here: https://plot.ly/settings/api
'''
''' Step #1: Prepare the Data '''
# (*) To communicate with Plotly's server, sign in with credentials file
import plotly.plotly as py
# (*) Useful Python/Plotly tools
from random import choice
from scrapy import signals
from scrapy.exceptions import NotConfigured
class RotateUserAgentMiddleware(object):
"""Rotate user-agent for each request."""
def __init__(self, user_agents):
self.enabled = False
self.user_agents = user_agents
@kbarre123
kbarre123 / hacker_rank_cplus_template.cpp
Last active August 29, 2015 14:13
Hacker Rank C++ template
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int myFunction(int a, int b) {
return a+b;
}