Skip to content

Instantly share code, notes, and snippets.

View josep2's full-sized avatar
🎯
Focusing

Jowanza Joseph josep2

🎯
Focusing
View GitHub Profile
@SolomonMg
SolomonMg / gist:4043e15691756071b1ad
Created March 3, 2015 05:04
Read in data from Qualtrics to R (adapted from qualtrics R package - http://jason.bryer.org/qualtrics/)
library(RCurl)
getSurveyResults <- function (username,
token, surveyid, truncNames = 20,
Questions = NULL,
Labels = "1",
ExportTags = "1",
LocalTime = "1",
startDate = NULL, endDate = NULL) {
url = paste(
library(checkpoint)
checkpoint("2015-03-04")
require(devtools)
## no way to install EBImage reproducibly
source("http://bioconductor.org/biocLite.R")
biocLite("EBImage")
# latest commits as of 2015-03-04
install_github("ramnathv/rblocks", ref="a85e748390c17c752cc0ba961120d1e784fb1956")
@abresler
abresler / get_nba_player_game_logs
Created May 15, 2015 21:14
NBA Player Game Log Function
### Example get_nba_player_game_log_stats(player = "Zach Randolph", season = 2001:2014)
get_nba_player_game_log_stats <-
function(player, season , season.type = 'Regular Season') {
packages <-
c('dplyr', 'magrittr', 'jsonlite', 'stringr', 'tidyr', 'lubridate', 'readr')
lapply(packages, library, character.only = T)
players <-
"https://raw.githubusercontent.com/abresler/si_hackathon/master/data/nba/all_player_data.csv"%>%
read_csv()
@sprintingdev
sprintingdev / scraper.js
Created May 29, 2015 00:30
jasmine-node Asynchronous callback unit testing
var request = require("require"); //request npm module
var Scraper = function() {
};
Scraper.prototype.scrape = function(url, callback) {
request(url, function responseCallback(error, response, html) {
if(error) {
callback(error);
} else {
console.log(html);
@jeffThompson
jeffThompson / Apollo11GuidanceComputerVertAndNounList.txt
Created February 15, 2016 16:32
A list of "nouns" and "verbs" to control the Apollo 11 guidance computer.
APOLLO 11 GUIDANCE COMPUTER: VERB AND NOUN LIST
https://en.wikipedia.org/wiki/Apollo_Guidance_Computer#/media/File:Agc_verb-noun-list.jpg
VERB LIST
50 PLEASE PERFORM
51 PLEASE MARK
53 PLEASE MARK ALT LOG
54 REND COAS MARK
56 TERMINATE P20
58 STICKFLAG (R) V50N18 FLAG(S)
@dwickstrom
dwickstrom / nightmare.sh
Last active December 22, 2018 01:27
NightmareJS - install Electron on Ubuntu 14.04
apt-get -y update
apt-get -y upgrade
apt-get -y --force-yes install make unzip g++ libssl-dev git xvfb x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic x11-apps clang libdbus-1-dev libgtk2.0-dev libnotify-dev libgnome-keyring-dev libgconf2-dev libasound2-dev libcap-dev libcups2-dev libxtst-dev libxss1 libnss3-dev gcc-multilib g++-multilib
npm -f init
npm i -S nightmare
xvfb-run nodejs index.js

Shiny app to highlight on a Leaflet map by brushing a Plotly chart. Run for yourself with (provided all of the packages are installed):

shiny::runGist('da941dac84f730adcdde')

To get this to work on another dataset, you're going to need to have a sequential ID variable that matches the pointNumber column in the data frame generated by Plotly's event_data. See the setup.R script for how this was derived.

@hrbrmstr
hrbrmstr / aplot.png
Last active March 27, 2016 03:37
Nuclear Explosions
aplot.png
library(idbr)
library(dplyr)
library(ggplot2)
library(tidyr)
library(countrycode)
library(gganimate)
library(tweenr)
ctrys <- countrycode(c('South Africa', 'Botswana', 'Lesotho', 'Namibia', 'Zimbabwe', 'Swaziland'),
'country.name', 'fips104')
package org.deeplearning4j.examples.dataExamples;
import org.datavec.api.io.labels.ParentPathLabelGenerator;
import org.datavec.api.records.listener.impl.LogRecordListener;
import org.datavec.api.split.FileSplit;
import org.datavec.image.loader.NativeImageLoader;
import org.datavec.image.recordreader.ImageRecordReader;
import org.deeplearning4j.datasets.datavec.RecordReaderDataSetIterator;
import org.deeplearning4j.eval.Evaluation;
import org.deeplearning4j.nn.api.OptimizationAlgorithm;