Skip to content

Instantly share code, notes, and snippets.

Jas Sohi j450h1

Block or report user

Report or block j450h1

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@j450h1
j450h1 / bb8_with_ggplot2.R
Created Jan 31, 2018 — forked from pvictor/bb8_with_ggplot2.R
A Star Wars BB-8 with ggplot2 !
View bb8_with_ggplot2.R
# BB-8 --------------------------------------------------------------------
# Inspired by Brian Hough in http://codepen.io/bhough/pen/wawrPL
# Packages ----------------------------------------------------------------
library("dplyr")
library("ggplot2")
@j450h1
j450h1 / send_email_mailgun.R
Created Jan 15, 2018 — forked from MarkEdmondson1234/send_email_mailgun.R
Send an email via an R function using Mailgun
View send_email_mailgun.R
#' Email a user a report is ready
#'
#' Requires an account at Mailgun: https://mailgun.com
#' Pre-verification can only send to a whitelist of emails you configure
#'
#' @param email Email to send to
#' @param mail_message Any extra info
#'
#' @return TRUE if successful email sent
#' @import httr
View Country Currency Code Mappings
Country,CountryCode,Currency,Code
New Zealand,NZ,New Zealand Dollars,NZD
Cook Islands,CK,New Zealand Dollars,NZD
Niue,NU,New Zealand Dollars,NZD
Pitcairn,PN,New Zealand Dollars,NZD
Tokelau,TK,New Zealand Dollars,NZD
Australia,AU,Australian Dollars,AUD
Christmas Island,CX,Australian Dollars,AUD
Cocos (Keeling) Islands,CC,Australian Dollars,AUD
Heard and Mc Donald Islands,HM,Australian Dollars,AUD
@j450h1
j450h1 / active-issues.sql
Created Apr 28, 2017 — forked from alysonla/active-issues.sql
Queries that power the open source section of the 2016 Octoverse report https://octoverse.github.com/
View active-issues.sql
-- Active issues
-- Count of total active issues in the specified time frame
-- Source: githubarchive public data set via Google BigQuery http://githubarchive.org/
SELECT
COUNT(DISTINCT JSON_EXTRACT_SCALAR(events.payload, '$.issue.id')) AS events_issue_count
FROM (SELECT * FROM TABLE_DATE_RANGE([githubarchive:day.],TIMESTAMP('2015-09-01'),TIMESTAMP('2016-08-31')))
AS events
-- 10,723,492 active issues
@j450h1
j450h1 / active-issues.sql
Created Apr 28, 2017 — forked from alysonla/active-issues.sql
Queries that power the open source section of the 2016 Octoverse report https://octoverse.github.com/
View active-issues.sql
-- Active issues
-- Count of total active issues in the specified time frame
-- Source: githubarchive public data set via Google BigQuery http://githubarchive.org/
SELECT
COUNT(DISTINCT JSON_EXTRACT_SCALAR(events.payload, '$.issue.id')) AS events_issue_count
FROM (SELECT * FROM TABLE_DATE_RANGE([githubarchive:day.],TIMESTAMP('2015-09-01'),TIMESTAMP('2016-08-31')))
AS events
-- 10,723,492 active issues
@j450h1
j450h1 / catfacts.R
Created Oct 2, 2016 — forked from jennybc/catfacts.R
Goofing around with the catfacts API
View catfacts.R
httr::GET("http://catfacts-api.appspot.com/api/facts",
query = list(number = 5)) %>%
httr::content(as = "text", encoding = "UTF-8") %>%
jsonlite::fromJSON()
@j450h1
j450h1 / date_loop.sh
Created Oct 1, 2016 — forked from chluehr/date_loop.sh
Bash: Loop over dates
View date_loop.sh
#!/bin/bash
now=`date +"%Y-%m-%d" -d "05/06/2012"`
end=`date +"%Y-%m-%d" -d "05/23/2012"`
while [ "$now" != "$end" ] ;
do
now=`date +"%Y-%m-%d" -d "$now + 1 day"`;
echo $now
done
@j450h1
j450h1 / apple_health_load_analysis_R.r
Created Sep 29, 2016 — forked from ryanpraski/apple_health_load_analysis_R.r
Load Apple Health Kit export.xml file in R then analyze and visualize Steps Data using R
View apple_health_load_analysis_R.r
library(dplyr)
library(ggplot2)
library(lubridate)
library(XML)
#load apple health export.xml file
xml <- xmlParse("C:\\Users\\praskry\\Desktop\\apple_health_data\\export.xml")
#transform xml file to data frame - select the Record rows from the xml file
df <- XML:::xmlAttrsToDataFrame(xml["//Record"])
@j450h1
j450h1 / 0_reuse_code.js
Created Dec 8, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View gist:8acfb5e941b4427ebe67
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Fire up graphlab create"
]
},
{
You can’t perform that action at this time.