Skip to content

Instantly share code, notes, and snippets.

@ihercowitz
ihercowitz / xmlbuilder.py
Created August 22, 2012 12:37
Building a XML Tree as Easy as ABC in Python
'''
****************************************************************************************
Building a XML Tree as Easy as ABC in Python
This implementation requires lxml
Created by Igor Hercowitz
2012-07-04
******************************************************************************************
'''
@jordeu
jordeu / gist:5275092
Last active July 25, 2021 16:44
An example of Markdown with a TOC table working in bitbucket.
- [User guide](#markdown-header-user-guide)
- [Installation](#markdown-header-installation)
- [Installation and Execution](#markdown-header-installation-and-execution)
- [Download and install](#markdown-header-download-and-install)
- [Execution](#markdown-header-execution)
- [Advanced configuration](#markdown-header-advanced-configuration)
- [Update](#markdown-header-update)
- [Administration](#markdown-header-administration)
- [Access managment](#markdown-header-access-managment)
- [Customizing SVGMap](#markdown-header-customizing-svgmap)
@atorralb
atorralb / follow links
Created September 20, 2014 00:56
This is a nice way to show you how to follow links or tell phantomjs how to proceed aftter opening each link
@alex23lemm
alex23lemm / gist:40046aba037bac7b9808
Last active June 24, 2019 08:58
RSelenium: Navigating using the Selenium Server binary / default remoteDriver
# sandbox.R is used to capture intermediate results of potential upcoming
# features which might make it into production.
# Check out the RSelenium package
#
# Load libraries and config file -----------------------------------------------
library(RSelenium)
library(yaml)
@rafaan
rafaan / gist:4ddc91ae47ea46a46c0b
Created February 24, 2015 20:24
Convert Nested JSON to Pandas DataFrame and Flatten List in a Column
import json
from pandas.io.json import json_normalize
import pandas as pd
with open('C:\filename.json') as f:
data = json.load(f)
df = pd.DataFrame(data)
normalized_df = json_normalize(df['nested_json_object'])
@PurpleBooth
PurpleBooth / README-Template.md
Last active June 20, 2024 01:55
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@jmsdnns
jmsdnns / walk_through_twitter.js
Last active June 1, 2018 17:10
PhantomJS code for scrolling to the end of a Twitter timeline
var fs = require('fs'),
page = new WebPage(),
url = 'https://twitter.com/jmsdnns',
stepOffset = 0,
stepCounter = 0,
full_path = "/Users/jmsdnns/Projects/ghst/img-tw";
page.open(url);
page.onLoadFinished = function(status) {
@daattali
daattali / rselenium-taxonomer-1-upload.R
Last active June 24, 2019 09:00
Use RSelenium to automatically upload many FASTQ files, submit each to "full analysis" when it's ready, and download the analyzed file on Taxonomer.com
# This script uploads all the FAST files to the taxonomer server (only one file can be uploaded at a time)
# Assumes that you have RSelenium package installed and that you've got a simple selenium example to work
if (FALSE) {
fastq_files <- c(
list.files(# WHERE ARE THE FILES?, pattern = "fastq.gz$", full.names = TRUE)
)
login_password <- "" # what is my password???
library(RSelenium)
@fxi
fxi / README.md
Last active April 18, 2019 15:48
Experimental work on forked computation in shiny app using the package "parallel".

Shiny asynchronous jobs

Experiemental work on forked computation in shiny app using the package "parallel".

Does not work on windows.

Example

@theriley106
theriley106 / congressEducation.py
Created December 9, 2017 19:17
Web Scraping congress education information
import requests
import bs4
import re
import json
listOfCongress = []
url = 'https://www.govtrack.us/congress/members/current?sort=sortname&page=1&faceting=false&allow_redirect=false&do_search=1'
congressCount = requests.get(url).json()['total']
information = {}