Skip to content

Instantly share code, notes, and snippets.

View wahalulu's full-sized avatar

Marck Vaisman wahalulu

View GitHub Profile
@killercup
killercup / pandoc.css
Created July 3, 2013 11:31
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@Vessy
Vessy / plotNetworksUsingGephi.R
Last active February 24, 2022 09:03
An example how to use R and rgexf package to create a .gexf file for network visualization in Gephi
# Plotting networks in R
# An example how to use R and rgexf package to create a .gexf file for network visualization in Gephi
############################################################################################
# Clear workspace
rm(list = ls())
# Load libraries
library("igraph")
library("plyr")
@noamross
noamross / slowGET.R
Created June 26, 2014 20:15
slowGET - A throttled version of GET
throttle = new.env(parent = emptyenv())
throttle$recent = data.frame(domain = character(), last_visit = character())
#' A throttled version of GET
#'
#' This uses \code{httr::GET} to fetch a web page, but throttles based on domains.
#'
#' \code{slowGET} keeps a list of domains recently accessed by itself in a
#' separate environment. If a domain has been accessed since \code{pause}
#' seconds ago, it will delay execution until that time has passed
@sebsto
sebsto / gist:19b99f1fa1f32cae5d00
Created August 8, 2014 15:53
Install Maven with Yum on Amazon Linux
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven
mvn --version
@seanorama
seanorama / vbox-to-vagrant.md
Last active June 17, 2016 21:52
hdp sandbox vagrant

Create a local Vagrant base box from an existing VirtualBox VM

What

  • Setting up a new development VM should be as easy as 2 commands. And it is:
    • vagrant init; vagrant up
  • In this example we are converting the HDP Sandbox to be used in this way. But the howto will work with any existing VM.

Why

@conormm
conormm / r-to-python-data-wrangling-basics.md
Last active June 26, 2024 07:56
R to Python: Data wrangling with dplyr and pandas

R to python data wrangling snippets

The dplyr package in R makes data wrangling significantly easier. The beauty of dplyr is that, by design, the options available are limited. Specifically, a set of key verbs form the core of the package. Using these verbs you can solve a wide range of data problems effectively in a shorter timeframe. Whilse transitioning to Python I have greatly missed the ease with which I can think through and solve problems using dplyr in R. The purpose of this document is to demonstrate how to execute the key dplyr verbs when manipulating data using Python (with the pandas package).

dplyr is organised around six key verbs:

@zonca
zonca / nginx.conf
Created April 13, 2016 01:28
Jupyterhub NGINX reverse proxy with SSL, replace HOSTNAME with a hostname or _
ser www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
@cosmincatalin
cosmincatalin / install-rstudio-server.sh
Last active October 27, 2022 11:07
AWS EMR bootstrap to install RStudio Server along with sparklyr
#!/bin/bash
# These variables can be overwritten using the arguments below
VERSION="1.1.463"
# drwho is listed as user in YARN's Resource Manager UI.
USER="drwho"
# Depending on where the EMR cluster lives, you might have to change this to avoid security issues.
# To change the default password (and user), use the arguments bellow.
# If the cluster is not visible on the Internet, you can just leave the defaults for convenience.
PASS="tardis"
@mattiaslundberg
mattiaslundberg / Ansible Let's Encrypt Nginx setup
Last active June 10, 2024 01:44
Let's Encrypt Nginx setup with Ansible
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@tomz
tomz / rstudio_sparkr_emr4-proc.sh
Created October 29, 2016 18:38
rstudio_sparkr_emr4-proc.sh
#!/bin/bash
set -x -e
# AWS EMR bootstrap script
# for installing open-source R (www.r-project.org) with RHadoop packages and RStudio on AWS EMR
#
# tested with AMI 4.0.0 (hadoop 2.6.0)
#
# schmidbe@amazon.de
# 24. September 2014