Skip to content

Instantly share code, notes, and snippets.

View basilesimon's full-sized avatar

Basile Simon basilesimon

View GitHub Profile
@basilesimon
basilesimon / links_collections.json
Created January 14, 2015 17:40
Scraping CENTCOM's PRs with Python
@basilesimon
basilesimon / script.py
Created January 22, 2015 17:25
Scraping CENTCOM's PRs with Python
import json
from bs4 import BeautifulSoup
from urllib2 import urlopen
from urlparse import urljoin
BASE_URL = "http://www.centcom.mil"
BASE_NEWS_URL = "http://www.centcom.mil/en/news"
NEWS_PAGE_URL = BASE_NEWS_URL + "/P"
@basilesimon
basilesimon / list.csv
Last active August 29, 2015 14:16
General Election 2015 candidates' Twitter handles
WAKLibDems RuthSmeeth mitch_1uk Go4Lowe ReshamKotecha Jack_Tinley iaingartside votejamesberry CllrScottMann CllrAnnSteward CharlotteHT_ julianknight15 lindsey4wnorth KevinGillottPPC WillJMartindale SamJRushworth RuthCadbury Mari_Williams JoeCookeLabour paulasherriff natashamillward rupahuq Steph_Peacock CatherineWest1 RichardBurgon lloydrm ToddDForeman Jessica_Asato annaturley SachinPatel_87 wdjstraw HuwSECambLabour KateVotesLabour JuliaTickridge clairethomas1 liverlibdems DrJennyWoods gracelibdem liz4stratford JackieLibDem ann4oxfordeast DavidHMalone derbynukipppc Neilkelly13 stevenjbrookes green_mac robjlinds MachanUkip ettiespencer howell_karen charliekiss brisfox CllrMattBrown cllrsrichardson angelamawle ianddriver dinahkeal emmawarman mapesburygreen maureenchilds2 davidschofiel18 CllrRichardLee ukip_swindon idhamramadi kevin_kerrigan1 xanderedz77 paulhalliday PaulForWest
{
"nodes": [
{
"name": "intro",
"text": "Hey, it's Salif. I'm finally leaving. I can't live here anymore, Syria's too dangerous now."
},
{
"text": "One of my cousins is in Germany. He's a barber, like my dad used to be."
},
{
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
AdamAfriyie
adamhollowaymp
Adrian_BaileyMP
alanbrownsnp
alancampbellmp
alanduncanmp
AlanMakMP
alanwhiteheadmp
AlasdairMcD_MP
AlbertOwenMP
@basilesimon
basilesimon / gist:2526cd881068a7559c8082fd06b3fafe
Created June 1, 2016 18:04
SQL - Wordpress Word Count across *all* pages
SELECT SUM(LENGTH(post_content) - LENGTH(REPLACE(post_content, ' ', '')) + 1) as 'Word Count' FROM `wp_posts` WHERE post_status='publish' AND post_type='page';
@basilesimon
basilesimon / chartpeter2.png
Last active November 10, 2016 15:54
UK trade in goods and services balance with selected non-EU countries, 1999 to 2015, in £ millions
chartpeter2.png
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<!-- Animate Dashed line - based off http://css-tricks.com/svg-line-animation-works
-->
@basilesimon
basilesimon / index.html
Last active January 18, 2017 18:14 — forked from methodofaction/index.html
Animate path in D3
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<style type="text/css">
#line{
width: 100%;
margin: 20px 0;
height: 300px;
}