Skip to content

Instantly share code, notes, and snippets.

View danielsamuels's full-sized avatar

Daniel Finch danielsamuels

View GitHub Profile
import time
from threading import Thread
import cflib.crtp
from cflib.crazyflie import Crazyflie
class Main:
# Initial values, you can use these to set trim etc.
{
"color_scheme": "Packages/User/Blackboard (SL).tmTheme",
"detect_indentation": false,
"detect_slow_plugins": false,
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
"*.pyc",
"*.pyo",
"*.exe",
@danielsamuels
danielsamuels / main.py
Last active August 29, 2015 14:01
BBC Twitter analysis
"""
A Python script to pull out all Tweets from the main BBC accounts tweeting about
the European Elections 2014. The aim is to analyse the data to see which
political party was tweeted about the most.
Data collection:
Per account, without retweets, where the content matches a keyword.
Per account, with retweets, where the content matches a keyword.
Data format:
{
"auto_upgrade_last_run": null,
"installed_packages":
[
"Anaconda",
"AutoPEP8",
"BracketHighlighter",
"Djaneiro",
"EJS",
"Emmet",
(moneymover-application)James-Dellar-MacBook-Pro-retina:moneymover-application danielsamuels$ brew list
gdbm git jpeg openssl python readline sqlite
root@ubuntu-server:~# apt-get install postgresql-9.3 -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libossp-uuid16 libxslt1.1
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
postgresql-client-9.3 postgresql-client-common postgresql-common
Suggested packages:
[
"assertAlmostEqual",
"assertAlmostEquals",
"assertContains",
"assertDictContainsSubset",
"assertDictEqual",
"assertEqual",
"assertEquals",
"assertFalse",
"assertFieldOutput",
/Users/danielsamuels/Workspace/cms-testing/.venv/lib/python2.7/site-packages/sorl/thumbnail/helpers.py:6: RemovedInDjango19Warning: django.utils.importlib will be removed in Django 1.9.
from django.utils.importlib import import_module
/Users/danielsamuels/Workspace/cms-testing/.venv/lib/python2.7/site-packages/reversion/models.py:6: RemovedInDjango19Warning: django.contrib.contenttypes.generic is deprecated and will be removed in Django 1.9. Its contents have been moved to the fields, forms, and admin submodules of django.contrib.contenttypes.
from django.contrib.contenttypes import generic
/Users/danielsamuels/Workspace/cms-testing/.venv/lib/python2.7/site-packages/django/contrib/admin/util.py:7: RemovedInDjango19Warning: The django.contrib.admin.util module has been renamed. Use django.contrib.admin.utils instead.
"Use django.contrib.admin.utils instead.", RemovedInDjango19Warning)
/Users/danielsamuels/Workspace/cms-testing/.venv/lib/python2.7/site-packages/historylinks/models.py:8: RemovedInDjango
# Fix no spaces after opening braces
\{([\{|%])(\w+) -> {\1 \2
# Fix no spaces before closing braces
([\w']+)([}|%])\} -> \1 \2}
# Test cases
{{ row 1 }}
{{row2}}
{% row 3 %}
from selenium import webdriver
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Firefox()
driver.get('http://google.com')
# Log in to the developer console.
driver.find_element_by_id('Email').send_keys(args.google_email)
driver.find_element_by_id('Passwd').send_keys(args.google_password)
driver.find_element_by_id('Passwd').send_keys(Keys.RETURN)