Skip to content

Instantly share code, notes, and snippets.

Avatar

Ray Lugo, Jr. rlugojr

View GitHub Profile
@rlugojr
rlugojr / grunt-hugo-lunrjs.md
Created Mar 28, 2017 — forked from sebz/grunt-hugo-lunrjs.md
hugo + gruntjs + lunrjs = <3 search
View grunt-hugo-lunrjs.md
@rlugojr
rlugojr / Pandas and Seaborn.ipynb
Created Feb 23, 2017 — forked from 5agado/Pandas and Seaborn.ipynb
Data Manipulation and Visualization with Pandas and Seaborn — A Practical Introduction
View Pandas and Seaborn.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rlugojr
rlugojr / animate.R
Created Feb 9, 2017 — forked from thomasp85/animate.R
Animating graph over time
View animate.R
library(ggraph)
library(gganimate)
library(igraph)
# Data from http://konect.uni-koblenz.de/networks/sociopatterns-infectious
infect <- read.table('out.sociopatterns-infectious', skip = 2, sep = ' ', stringsAsFactors = FALSE)
infect$V3 <- NULL
names(infect) <- c('from', 'to', 'time')
infect$timebins <- as.numeric(cut(infect$time, breaks = 100))
# We want that nice fading effect so we need to add extra data for the trailing
@rlugojr
rlugojr / log.R
Created Dec 29, 2016 — forked from mollietaylor/log.R
Plot Weekly or Monthly Totals in R
View log.R
library(ggplot2)
library(scales)
# load data:
log <- data.frame(Date = c("2013/05/25","2013/05/28","2013/05/31","2013/06/01","2013/06/02","2013/06/05","2013/06/07"),
Quantity = c(9,1,15,4,5,17,18))
log
str(log)
# convert date variable from factor to date format:
View gist:4cc00a8671fb5c7731a9b2a62ef3f515
---
title: "Codebook template"
author: "Your name here"
date: "The date here"
output:
html_document:
keep_md: yes
---
## Project Description
@rlugojr
rlugojr / npm-cheat-sheet.md
Created Oct 21, 2016 — forked from AvnerCohen/npm-cheat-sheet.md
Node.js - npm Cheat Sheet
View npm-cheat-sheet.md

Node.js - npm Cheat Sheet

(Full description and list of commands at - https://npmjs.org/doc/index.html)

##List of less common (however useful) NPM commands

######Prepand ./bin to your $PATH Make sure to export your local $PATH and prepand relative ./node_modules/.bin/:

@rlugojr
rlugojr / install_ffmpeg_ubuntu.sh
Created Oct 15, 2016 — forked from xdamman/install_ffmpeg_ubuntu.sh
Install latest ffmpeg on ubuntu 12.04 or 14.04
View install_ffmpeg_ubuntu.sh
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
@rlugojr
rlugojr / readme.md
Created Aug 22, 2016 — forked from xem/readme.md
Maths & trigonometry cheat sheet for 2D & 3D games
View readme.md

Conventions

  • A = [xA, yA] is a point on the 2D plane. Same for B, C, ...
  • lengths are in any unit (ex: pixels)
  • code snippets are in JavaScript

Degrees to radians

angleRad = angleDeg * Math.PI / 180;

View regex-weburl.js
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
@rlugojr
rlugojr / d3-force.js
Created Jul 20, 2016 — forked from emeeks/d3-force.js
BBox Word Cloud
View d3-force.js
// https://d3js.org/d3-force/ Version 1.0.0. Copyright 2016 Mike Bostock.
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-quadtree'), require('d3-collection'), require('d3-dispatch'), require('d3-timer')) :
typeof define === 'function' && define.amd ? define(['exports', 'd3-quadtree', 'd3-collection', 'd3-dispatch', 'd3-timer'], factory) :
(factory((global.d3 = global.d3 || {}),global.d3,global.d3,global.d3,global.d3));
}(this, function (exports,d3Quadtree,d3Collection,d3Dispatch,d3Timer) { 'use strict';
function center(x, y) {
var nodes;