Skip to content

Instantly share code, notes, and snippets.

View gwerbin's full-sized avatar
💭
I might be slow to respond.

Greg Werbin gwerbin

💭
I might be slow to respond.
View GitHub Profile
@X4
X4 / sklearn-pipeline.py
Last active October 30, 2017 00:28
Building a SciKit-Learn Pipeline
# Make ML-Pipeline Runs Reproducible
random_state=7
# Testing our Pipeline with an ML-Ready Dataset
from sklearn.datasets import load_iris
iris = load_iris()
# Assign ML-Input and Ml-Target
Xi = iris.data # Input
yi = iris.target # Output
@fcard
fcard / vimscript_parser.vim
Created March 28, 2017 23:01
Vimscript parser in vimscript. Sure why not
" Command: Command
"
" A different take on command creation,
" Command creates a namespace for which
" its implementation functions can be
" stored in. The command name also comes
" first, followed by its argument type
" in parentheses, to mimic function
" definitions. name Anything preceding a ':='
" command body.
@kurtbrose
kurtbrose / parsley_examples.py
Last active July 19, 2018 16:03
little parsley examples
# how to separate items in a list from separators
parsley.makeGrammar('''
a_list = ('a':it ','? -> it)*
''', {})('a,a,a').a_list()
# result is ['a', 'a', 'a']
# strict comma-delimeted items (at least one item)
parsley.makeGrammar('''
a_list = 'a':first (',' 'a')*:rest -> [first] + rest
@alexer
alexer / sbstd.py
Last active October 29, 2018 16:01
"Should Be in the STDlib" - aka. my helper library, which has outgrown it's original name
# Really useful in some situations, but you can see how often it's actually been used, since cmp() doesn't even exist anymore...
sign = lambda v: cmp(v, 0)
clamp = lambda v, minv, maxv: min(max(v, minv), maxv)
# These are a bit of a misnomers, since below/above suggests lt/gt, while these are le/ge
clamp_below = lambda v, maxv: min(v, maxv)
clamp_above = lambda v, minv: max(v, minv)
div_ceil = lambda dividend, divisor: (dividend - 1) // divisor + 1
# Just for symmetry
@memeplex
memeplex / base16.py
Last active March 10, 2019 01:29
Base16 default theme for ipython + pygments + prompt toolkit closely matching vim base16 theme.
# -*- coding: utf-8 -*-
"""
Base16 Default Dark by Chris Kempson (http://chriskempson.com).
IPython Template by Carlos Pita (carlosjosepita@gmail.com).
Created with Base16 Builder by Chris Kempson.
"""
from prompt_toolkit.terminal.vt100_output import _256_colors
@TheDcoder
TheDcoder / UNLICENSE
Last active July 6, 2019 14:07
strseg - Get delimiter-separated segments from a string in a non-destructive method
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@pradyunsg
pradyunsg / proposal.md
Last active February 7, 2020 19:56
@pradyunsg's GSoC 2017 proposal

Adding Proper Dependency Resolution to pip

  • Name: Pradyun S. Gedam
  • Email: [pradyunsg@gmail.com][mailto-email]
  • Github: [pradyunsg][github-profile]
  • University: [VIT University, Vellore, India][vit-homepage]
  • Course: Bachelor of Technology in Computer Science and Engineering
  • Course Term: 2016/17 - 2019/20 (4 Year)
  • Timezone: IST (GMT +5:30)
  • GSoC Blog RSS Feed URL:
@dergachev
dergachev / dergachev-gists-gems.md
Last active October 13, 2020 14:32
Looking for gems buried in my old gists

Looking for gems buried in my old gists

Inspired to do some spring cleaning today, I reviewed my archived gists to see if there's anything noteworthy. I was pleasantly surprised to find a few nuggets buried amongst random error logs and git diffs.

Some of them are interesting technical guides that took hours to write, and it's a shame that they've rotted away in obscurity. Several others were picked up by google, and turns out they even got a few comments and a bunch of stars.

@equalsraf
equalsraf / NeovimCygwin.md
Last active May 14, 2021 11:42
Neovim in Cygwin

TLDR; no, libuv doesn't work in Cygwin just yet, see at the bottom.

Requirements

I tested using the master branch (9d3449852bd35c9283948186d0259c1bf73b8579 or later)

I installed the following in the cygwin setup

  • gcc-c++ make cmake pkg-config libtool
@GantMan
GantMan / NEW_OPENSOURCE_TODO.md
Last active December 27, 2021 23:20
ALL the things to do when starting a new Github Project - IR JavaScript | TypeScript

Step 1 - Create nest on Github

  1. Click Plus
  2. New Repository
  3. IR/REPO_NAME
  4. PROJECT_DESCRIPTION
  5. Do not initialize with anything (easier to add after)
  6. Star your repo
  7. Pull your repo down locally and cd to it