Skip to content

Instantly share code, notes, and snippets.

View ramnathv's full-sized avatar

Ramnath Vaidyanathan ramnathv

View GitHub Profile
@arunsrinivasan
arunsrinivasan / tweet_reply.md
Last active July 27, 2018 04:38
automatic indexing vs between() on integer ranges

Updated June 16 with latest devel

data.table's automatic indexing:

Generating some data first:

# R version 3.3.0
require(data.table) ## 1.9.7, commit 2433, github
require(dplyr) ## devel, commit 3189, github
@benjie
benjie / README.md
Last active January 17, 2023 15:16
Long Live CoffeeScript and Long Live ES6

Long Live CoffeeScript and Long Live ES6

Clearly ES6 is a huge improvement over ES5, and tools like [6to5][] allow us to use these cool features now. I was reading [Replace CoffeeScript with ES6][replace coffeescript] by [Blake Williams][] and thought it was a great summary of how ES6 solves many of the same problems that CoffeeScript solves; however I'd like to comment on a few of Blake's points and talk about why I'll be sticking with CoffeeScript.

Classes

Classes in ES6 (like many of the syntax changes in ES6) are very similar to the CoffeeScript equivalent. To support browsers that are not fully ES5 compliant (e.g. IE8-), however, we still can't really use getters/setters, so ignoring these the comparison is:

@chroth7
chroth7 / reactD3rescources.md
Last active December 6, 2017 05:37
React/D3 Resources
@gilbert
gilbert / comment-model.js
Last active March 31, 2018 19:38
Mithril-friendly Model Layer
var Comment = {}
Comment.store = Store('Comment')
Comment.fetchForPost = function (postId) {
return m.request({ method: 'GET', url: '/api/post/' + postId + '/comments' })
.then(Comment.store.syncAll)
}
@jennybc
jennybc / polygraphing-films.R
Created April 9, 2016 16:46
Get polygraphing's film data into R
## http://polygraph.cool/films/
## https://github.com/matthewfdaniels/scripts
x <- "https://raw.githubusercontent.com/matthewfdaniels/scripts/master/data/character_list5.csv"
characters <- read.csv(x, na.strings = c("NULL", "?"),
fileEncoding = "ISO-8859-1", stringsAsFactors = FALSE)
## some ages are clearly (negative) birth years ... oops
characters$age[!is.na(characters$age) & characters$age < 0] <- NA
characters$age[!is.na(characters$age) & characters$age > 105] <- NA
@nitingupta2
nitingupta2 / netlify_deploy.md
Last active August 15, 2017 00:33
Deploy a blogdown website on Netlify

Assuming you have:

  1. A website built using blogdown and Hugo
  2. Hosted on GitHub pages, a.k.a .github.io
  3. Built your blogdown website on your local machine blogdown:::serve_site(), which is generated within the public folder
  4. Sync'd your local public repository to .github.io repository in your github account

You want to deploy your website to Netlify, which supports custom domains with HTTPS:

  1. Sign up on Netlify with your GitHub account.
# This example demonstrates running furrr code distributed on 2 AWS instances ("nodes").
# The instances have already been created.
library(future)
library(furrr)
# Two t2.micro AWS instances
# Created from http://www.louisaslett.com/RStudio_AMI/
public_ip <- c("34.205.155.182", "34.201.26.217")
"""
Remove *all* default, hard-coded, CSS classes and inline styling attached to tables when calling df.to_html(),
and add your own classes to each tag ad hoc.
This will probably be extremely simple in the future when the styling API is more mature. For now, we bleach it.
May need to `conda install bleach` or `pip install bleach`
"""
import pandas as pd
@aditya-malte
aditya-malte / smallberta_pretraining.ipynb
Created February 22, 2020 13:41
smallBERTa_Pretraining.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.