Skip to content

Instantly share code, notes, and snippets.

View anguillanneuf's full-sized avatar
🏠

Tianzi Cai anguillanneuf

🏠
View GitHub Profile
@BenWhitehead
BenWhitehead / mvn-grep-deps-libraries-bom.bash
Created November 17, 2021 18:32
A small bash script which specifies the maven (mvn) command to list resolution of those artifacts from `com.google.cloud:libraries-bom`
#!/bin/bash
function main () { (
includePatterns=(
"com.google.apis.grpc:*" # generated grpc and proto libraries
"com.google.api:*" # gax, api-common, etc.
"com.google.api-client:*" # api client between discovery doc clients and http-client
"com.google.apis:*" # discovery doc generated clients
"com.google.auth:*" #
"com.google.cloud:*" # "clients" gapics/veneers
@crwilcox
crwilcox / bigquery_github.py
Last active February 19, 2020 05:17
Scan GitHub using BigQuery
from google.cloud import bigquery
import json
GITHUB_USERNAME = 'crwilcox'
START_DATE = "2019-08-26"
END_DATE = "2020-02-16"
client = bigquery.client.Client()
query = f"""SELECT repository, type, event AS status, COUNT(*) AS count
import numpy as np
from numpy.linalg import inv
x_observations = np.array([4000, 4260, 4550, 4860, 5110])
v_observations = np.array([280, 282, 285, 286, 290])
z = np.c_[x_observations, v_observations]
# Initial Conditions
a = 2 # Acceleration
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@ronrest
ronrest / week_since.R
Last active August 29, 2015 14:23
Week Number since some arbitrary start date
# TODO: add an option that makes use of lubridate's quarter(date) if no value is
# entered for the *since* argument.
#===============================================================================
# WEEK_SINCE
#===============================================================================
#' @title week_since
#' @description calculates what week number some input date is, counting from
#' some specified starting date (eg the Start of Financial Year)
#' @details You can specify any start date you want by using the
@amatellanes
amatellanes / sublime.sh
Last active October 26, 2021 20:34
Install Sublime Text 3 on Ubuntu 14.04 LTS (Trusty Tahr)
sudo add-apt-repository ppa:webupd8team/sublime-text-3;
sudo apt-get update;
sudo apt-get install sublime-text-installer;
sudo ln -s /usr/lib/sublime-text-3/sublime_text /usr/local/bin/sublime;