Skip to content

Instantly share code, notes, and snippets.

View j450h1's full-sized avatar

Jas Sohi j450h1

  • Microsoft
  • Vancouver, BC
View GitHub Profile
@erikbern
erikbern / install-tensorflow.sh
Last active June 26, 2023 00:40
Installing TensorFlow on EC2
# Note – this is not a bash script (some of the steps require reboot)
# I named it .sh just so Github does correct syntax highlighting.
#
# This is also available as an AMI in us-east-1 (virginia): ami-cf5028a5
#
# The CUDA part is mostly based on this excellent blog post:
# http://tleyden.github.io/blog/2014/10/25/cuda-6-dot-5-on-aws-gpu-instance-running-ubuntu-14-dot-04/
# Install various packages
sudo apt-get update
with
years(year_id, year) as (
select i, 'Year ' || i
from generate_series(0, 3) i
),
regions(region_id, region) as (
select i, 'Region ' || i
from generate_series(0, 3) i
@j450h1
j450h1 / .Rhistory
Last active September 20, 2015 11:57 — forked from nikolay-shenkov/create_vis.js
Comparing Revenue & Attendance Across Leagues (NHL, NBA, MLB, NFL)
We couldn’t find that file to show.
@LindaLawton
LindaLawton / GoogleAnalyticsOauth2
Last active April 15, 2019 09:08
How to connect to Google Analytics with Oauth2 and the .net client library
string[] scopes = new string[] {
AnalyticsService.Scope.Analytics, // view and manage your Google Analytics data
AnalyticsService.Scope.AnalyticsEdit, // Edit and manage Google Analytics Account
AnalyticsService.Scope.AnalyticsManageUsers, // Edit and manage Google Analytics Users
AnalyticsService.Scope.AnalyticsReadonly}; // View Google Analytics Data
var clientId = "[Client ID]"; // From https://console.developers.google.com
var clientSecret = "xxx"; // From https://console.developers.google.com
// here is where we Request the user to give us access, or use the Refresh Token that was previously stored in %AppData%
var credential = GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecrets { ClientId = clientId,
@michi88
michi88 / gist:a5553d7f3613cdfa8935
Created July 16, 2015 00:20
Google Analytics premium BiqQuery ga_sessions table export fields changelog
#!/bin/bash
# Somehow Google does not provide a changelog for when they add fields to the ga_sessions table
# export you get with Google Analitics premium. Here's some of it by trial and error... :(
COLUMNS="
visitorId,
visitNumber,
visitId,
visitStartTime,
@briandconnelly
briandconnelly / setup_rstudio.sh
Last active April 13, 2021 21:46
Setup RStudio Server on a Google Compute Engine Instance (Debian)
#!/bin/bash
# Install RStudio Server on a Google Compute Engine instance running Debian
# Wheezy
CRAN_MIRROR='cran.rstudio.com'
pushd /tmp
# Install up-to-date version of R ---------------------------------------------
@igrigorik
igrigorik / json-bq-schema-generator.rb
Last active November 3, 2022 17:34
BigQuery JSON schema generator
require 'open-uri'
require 'zlib'
require 'yajl'
# References
# - https://developers.google.com/bigquery/preparing-data-for-bigquery#dataformats
# - https://developers.google.com/bigquery/docs/data#nested
#
def type(t)
@natelandau
natelandau / .bash_profile
Last active April 25, 2025 02:45
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@rtt
rtt / tinder-api-documentation.md
Last active March 10, 2025 07:24
Tinder API Documentation

Tinder API documentation

Note: this was written in April/May 2014 and the API may has definitely changed since. I have nothing to do with Tinder, nor its API, and I do not offer any support for anything you may build on top of this. Proceed with caution

http://rsty.org/

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)

@abo-abo
abo-abo / query.sql
Last active September 8, 2020 08:03
Use https://developers.google.com/bigquery/ to select top 100 repos by number of commits
select repository_name, count(repository_name) as pushes, repository_description, repository_url
from [githubarchive:github.timeline]
where type="PushEvent"
and repository_language="Emacs Lisp"
and parse_utc_usec(created_at) >= parse_utc_usec('2014-01-01 00:00:00')
group by repository_name, repository_description, repository_url
order by pushes desc
limit 100