Skip to content

Instantly share code, notes, and snippets.

View Nosferican's full-sized avatar

José Bayoán Santiago Calderón Nosferican

View GitHub Profile
@Nosferican
Nosferican / query and vars
Created February 25, 2021 16:49
Example of 5,000 User Account Type GitHub API GraphQL
fragment a on Node {id __typename ...on User{login} ...on Organization {login} ...on Bot {login}}query A($x1:[ID!]!,$x2:[ID!]!,$x3:[ID!]!,$x4:[ID!]!,$x5:[ID!]!,$x6:[ID!]!,$x7:[ID!]!,$x8:[ID!]!,$x9:[ID!]!,$x10:[ID!]!,$x11:[ID!]!,$x12:[ID!]!,$x13:[ID!]!,$x14:[ID!]!,$x15:[ID!]!,$x16:[ID!]!,$x17:[ID!]!,$x18:[ID!]!,$x19:[ID!]!,$x20:[ID!]!,$x21:[ID!]!,$x22:[ID!]!,$x23:[ID!]!,$x24:[ID!]!,$x25:[ID!]!,$x26:[ID!]!,$x27:[ID!]!,$x28:[ID!]!,$x29:[ID!]!,$x30:[ID!]!,$x31:[ID!]!,$x32:[ID!]!,$x33:[ID!]!,$x34:[ID!]!,$x35:[ID!]!,$x36:[ID!]!,$x37:[ID!]!,$x38:[ID!]!,$x39:[ID!]!,$x40:[ID!]!,$x41:[ID!]!,$x42:[ID!]!,$x43:[ID!]!,$x44:[ID!]!,$x45:[ID!]!,$x46:[ID!]!,$x47:[ID!]!,$x48:[ID!]!,$x49:[ID!]!,$x50:[ID!]!){_1:nodes(ids:$x1){...a} _2:nodes(ids:$x2){...a} _3:nodes(ids:$x3){...a} _4:nodes(ids:$x4){...a} _5:nodes(ids:$x5){...a} _6:nodes(ids:$x6){...a} _7:nodes(ids:$x7){...a} _8:nodes(ids:$x8){...a} _9:nodes(ids:$x9){...a} _10:nodes(ids:$x10){...a} _11:nodes(ids:$x11){...a} _12:nodes(ids:$x12){...a} _13:nodes(ids:$x13){...a} _14:nod
@Nosferican
Nosferican / leg_001.tsv
Created September 25, 2020 18:26
Candidatos legislativos del precinto electoral 1
Electoral Representativo Senatorial Afiliación Candidatura Candidato
1 1 1 Partido Nuevo Progresista Representante por Distrito Eddie Charbonier Chinea
1 1 1 Partido Nuevo Progresista Senador por Distrito Henry Neumann
1 1 1 Partido Nuevo Progresista Senador por Distrito Nitza Morán
1 1 1 Partido Nuevo Progresista Representante por Acumulación Lourdes Ramos
1 1 1 Partido Nuevo Progresista Representante por Acumulación José (Pichy) Torres Zamora
1 1 1 Partido Nuevo Progresista Representante por Acumulación Jorge Emmanuel Báez Pagán
1 1 1 Partido Nuevo Progresista Representante por Acumulación José Enrique (Quiquito) Meléndez Ortiz
1 1 1 Partido Nuevo Progresista Representante por Acumulación (Joven No Vidente) Néstor Alonso
1 1 1 Partido Nuevo Progresista Representante por Acumulación José Aponte Hernández
@Nosferican
Nosferican / minimal_reproducible_example.txt
Created May 4, 2020 01:28
Selenium 4-alpha WebDriver W3C status of endpoints
# Using Docker selenium/standalone-chrome:4
# I ran
POST http://localhost:4444/session
{
"status": 0,
"sessionId": "995a7f03fceb8a4633558900cd617329",
"value": {
"acceptInsecureCerts": false,
"browserName": "chrome",
"browserVersion": "81.0.4044.92",
@Nosferican
Nosferican / data.csv
Created August 1, 2019 18:28
Example data
id sequence period AUC formulation
1 TT 1 5.634789603169249 T
1 TT 2 6.1779441140506 T
2 TT 1 5.389071729816501 T
2 TT 2 5.081404364984463 T
3 TT 1 5.438079308923196 T
3 TT 2 4.59511985013459 T
4 TT 1 5.43372200355424 T
4 TT 2 5.560681631015528 T
5 TT 1 6.202535517187923 T
@Nosferican
Nosferican / Example4.1.sas
Created February 6, 2019 02:27
Patterson and Jones 2006 Example 4.1 (Cmax)
/*** SAS code for examples in Chapter 4 of ***/
/*** Bioequivalence and Statistics in Clinical Pharmacology, ***/
/*** by Scott Patterson and Byron Jones,***/
/*** Chapman and Hall/CRC Press: Boca Raton, London and New York, 2005.***/
/*** WARNING : PROGRAM OFFERED FOR USE WITHOUT ANY GUARANTEES ***/
/*** NO LIABILITY IS ACCEPTED FOR ANY LOSS RESULTING FROM USE OF ***/
/*** THIS SET OF SAS INTRUCTIONS ***/
@Nosferican
Nosferican / Reverse Dependencies.jl
Created October 25, 2018 18:19
Reverse Dependencies
using Pkg.TOML: parsefile
using Base.Iterators: flatten
pkgs = ((d for d in readdir(dir) if occursin(r"^[(aA-zZ|0-9)]+$", d))
for dir in joinpath.(first(DEPOT_PATH),"registries","General", string.('A':'Z'))) |>
flatten |>
collect
"""
cap(v::AbstractString)
1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0
1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0
1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0
1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0
1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
@Nosferican
Nosferican / mlogit.jl
Last active October 3, 2018 20:58
Draft of Multinomial Logistic Regression
# This is the draft code for generalizing GLM to vector generalized linear models (VGLM)
# Compared to Stata's mlogit (13.1) and R's multinom {nnet}, need to verify and correct mlogit vcov
# Code tested with Julia v"0.7.0-DEV.4993"
# Special Matrices
using LinearAlgebra: Hermitian, LowerTriangular, UpperTriangular, Diagonal
# Factorizations
using LinearAlgebra: Factorization, qrfact, cholfact!, QRPivoted, norm
# Functions
using LinearAlgebra: mul!, diag, copytri!
# Author: José Bayoán Santiago Calderón (@Nosferican)
# Set up the environment for this application
using Distributions: Normal, TDist
using Plots: Plot, PyPlotBackend, plot, density, savefig, plot!, pyplot
using StatPlots: StatPlots, @df
using Random: seed!
using Statistics: mean, quantile
using StatsBase: coef, coefnames, confint, countmap, dof_residual, levelsmap,
@Nosferican
Nosferican / reghdfe.do
Created December 3, 2017 19:39
reghdfe multiway clustering
use "http://www.stata-press.com/data/r13/grunfeld", clear
reghdfe mvalue invest kstock, noab cl(company year)
vce