Skip to content

Instantly share code, notes, and snippets.

View leoluyi's full-sized avatar
🎯
Focusing

Leo Lu leoluyi

🎯
Focusing
View GitHub Profile
@mpneuried
mpneuried / Makefile
Last active May 4, 2024 13:46
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@leonidessaguisagjr
leonidessaguisagjr / py-git-cat-file.py
Last active July 30, 2023 06:46
Studying git internals: implement `git cat-file` in Python
#!/usr/bin/env python3
"""Implementation of git cat-file in Python.
This Gist is published under the MIT License:
MIT License
Copyright (c) 2019 Leonides T. Saguisag, Jr.
Permission is hereby granted, free of charge, to any person obtaining a copy
@hrbrmstr
hrbrmstr / badmail.Rmd
Last active December 1, 2016 07:59
Code for this post:
---
title: "Visualizing the Clinton Email Network in R"
author: "hrbrmstr"
date: "`r Sys.Date()`"
output: html_document
---
```{r include=FALSE}
knitr::opts_chunk$set(
collapse=TRUE,
comment="#>",
@stevenpollack
stevenpollack / !README.MD
Last active February 28, 2024 00:56
A simple R package development best-practices-example

R package development "best practices"

The core of this tutorial gist lies in bestPracticesWalkThrough.R. Running assumes you have the following packages at versions equal (or above) those specified

library('devtools') # 1.9.1
library('testthat') # 0.11.0
library('stringr')  # 1.0.0
library('git2r') # 0.12.1
@ericjang
ericjang / TensorFlow_Windows.md
Last active March 27, 2021 22:19
Setting up TensorFlow on Windows using Docker.

TensorFlow development environment on Windows using Docker

Here are instructions to set up TensorFlow dev environment on Docker if you are running Windows, and configure it so that you can access Jupyter Notebook from within the VM + edit files in your text editor of choice on your Windows machine.

Installation

First, install https://www.docker.com/docker-toolbox

Since this is Windows, creating the Docker group "docker" is not necessary.

@Bekbolatov
Bekbolatov / tmux.md
Last active May 11, 2024 15:12
Clean tmux cheat-sheet

Clean tmux cheat-sheet

By resources

sessions

list-sessions        ls         -- List sessions managed by server
new-session          new        -- Create a new session
@hrbrmstr
hrbrmstr / bom.R
Last active July 16, 2019 09:40
test for and/or remove byte order mark in R
#' Tests whether a raw httr response or character vector has a byte order mark (BOM)
#'
#' \href{https://en.wikipedia.org/wiki/Byte_order_mark}{What is a byte order mark?}
#'
#' @param resp \code{httr} response object or a character vector
#' @param encoding can be one of \code{UTF-8}, \code{UTF-16} or \code{UTF-16BE}.
#' Although a BOM could be used with UTF-32 and other encodings, such
#' encodings are rarely used for data transmission and the three supported
#' encodings are the most likely ones folks in R will be working with from
#' web APIs.\cr\cr
@rochacbruno
rochacbruno / mainpython.md
Last active July 5, 2023 10:56
Use of __main__.py

The use of __main__.py to create executables

myprojectfolder/
    |_ __main__.py
    |_ __init__.py

Being __main__.py:

print("Hello")

@hadley
hadley / ds-training.md
Created March 13, 2015 18:49
My advise on what you need to do to become a data scientist...

If you were to give recommendations to your "little brother/sister" on things that they need to do to become a data scientist, what would those things be?

I think the "Data Science Venn Diagram" (http://drewconway.com/zia/2013/3/26/the-data-science-venn-diagram) is a great place to start. You need three things to be a good data scientist:

  • Statistical knowledge
  • Programming/hacking skills
  • Domain expertise

Statistical knowledge