Skip to content

Instantly share code, notes, and snippets.

View rgbkrk's full-sized avatar
🌎
Think globally, act locally

Kyle Kelley rgbkrk

🌎
Think globally, act locally
View GitHub Profile
@glebmikha
glebmikha / eda_prompt.md
Last active March 20, 2024 14:41
EDA Prompt for ChatGPT (and Humans)
  1. Calculate the percentage of missing values in each column and sort them in descending order.
    1. Missing values and outliers are not problems to be fixed! They are facts.
    2. During EDA you must not “fix” them because you have to deal with your data and problem as it is.
    3. If you see missing values, just report them.
  2. Identify and understand your target variable.
    1. Understand the type of the target variable: binary, categorical, or numeric.
    2. Examine the distribution of the target variable.
      1. For a binary variable (which needs to be converted into 0s and 1s if it is in string format), the mean (a proportion of 1s) is simply used.
      2. For a categorical variable, value counts are used.
  3. For a numeric variable, a histogram or a pandas' describe table is used.
@ceejbot
ceejbot / esm_in_node_proposal.md
Last active July 17, 2023 02:45
npm's proposal for supporting ES modules in node

ESM modules in node: npm edition

The proposal you’re about to read is not just a proposal. We have a working implementation of almost everything we discussed here. We encourage you to checkout and build our branch: our fork, with the relevant branch selected. Building and using the implementation will give you a better understanding of what using it as a developer is like.

Our implementation ended up differing from the proposal on some minor points. As our last action item before making a PR, we’re writing documentation on what we did. While I loathe pointing to tests in lieu of documentation, they will be helpful until we complete writing docs: the unit tests.

This repo also contains a bundled version of npm that has a new command, asset. You can read the documentation for and goals of that comma

@blahah
blahah / 1_basic_browser.js
Last active February 8, 2023 09:04
loading geoJSON examples
// we have a geoJSON file (in this case for Guinea) on the web:
var guinea = 'https://raw.githubusercontent.com/johan/world.geo.json/master/countries/GIN.geo.json'
// and we have a function that does something with the geoJSON file:
var handleGeoJSON = function (data) {
// data is the JSON parsed into a JS object
console.log(data)
}
// using jquery (you must have loaded jQuery first) - http://api.jquery.com/jquery.getjson
@nolanlawson
nolanlawson / parens-and-perf-counterpost.md
Last active August 14, 2023 20:08
"Parens and Performance" – counterpost

"Parens and Performance" – counterpost

Kyle Simpson (@getify) wrote a very thoughtful post decrying optimize-js, which is a tool I wrote that exploits known optimizations in JavaScript engines to make JS bundles parse faster (especially minified bundles, due to what could be reasonably described as a bug in Uglify).

Kyle lays out a good case, but I tend to disagree with nearly all his points. So here's my rebuttal.

@btroncone
btroncone / rxjs_operators_by_example.md
Last active July 16, 2023 14:57
RxJS 5 Operators By Example
console.log('Hello LabJack')
var ljn = require('labjack-nodejs');
var NanoTimer = require('nanotimer')
var fs = require('fs')
var now = require('performance-now')
var path = require('path')
var mkdirp = require('mkdirp').mkdirp
@kevana
kevana / create-machines.sh
Last active February 26, 2016 03:49
dvm + machine: Easy testing for apps that support multiple Docker versions
# create docker-machines and use dvm to switch client binaries.
docker-machine create \
--driver=virtualbox \
--virtualbox-boot2docker-url=https://github.com/boot2docker/boot2docker/releases/download/v1.10.2/boot2docker.iso \
1.10.2-dev
docker-machine create \
--driver=virtualbox \
--virtualbox-boot2docker-url=https://github.com/boot2docker/boot2docker/releases/download/v1.9.1/boot2docker.iso \
@ivanoats
ivanoats / jqh.js
Created December 10, 2015 04:32
Hyperscript for jQuery
// hyperscript for jQuery
// create nested HTML elements with a DSL
// used to create reusable, interactive HTML components
//
// based on the many implentations out there like
// https://github.com/dominictarr/hyperscript
// https://github.com/Matt-Esch/virtual-dom/tree/master/virtual-hyperscript
// and Elm https://github.com/evancz/elm-html
var $h = function(element, properties, content) {
var $component = $('<' + element + '>');
#!/bin/bash
# Assumes a pre-built carina cluster, e.g.:
#
# carina create --wait shipyard \
# && carina credentials shipyard \
# && eval `carina env shipyard`
#
@br3tt
br3tt / helpers.js
Last active December 5, 2015 16:37
class Helpers {
currentHP(db) { return db.PlayerInfo.CurrHP }
noCurrentHPGain(db) { return db.PlayerInfo.CurrentHPGain == 0.0 }
radiation(db) { return db.PlayerInfo.TotalDamages[5].Value }
aidItems(db) { return db.Inventory['48'] }
radiationMoreThan(rads) {
return db => {
this.radiation(db) > rads;
};