Skip to content

Instantly share code, notes, and snippets.

Avatar
💀
alter.

gregory nicholas gregorynicholas

💀
alter.
View GitHub Profile
@gregorynicholas
gregorynicholas / .inputrc
Last active Jul 7, 2020
OSX .inputrc to make terminal way better. and by better i mean i'm naked
View .inputrc
"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[5~": history-search-backward
"\e[6~": history-search-forward
"\e[3~": delete-char
"\e[2~": quoted-insert
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word
View css-fonts.css
pbalanced for paragraphs or body copy

t – balanced for headlines or titles
Arial, “Helvetica Neue, Helvetica, sans-serif - p, t
Baskerville, “Times New Roman”, Times, serif - p
Baskerville, Times, “Times New Roman”, serif - t
Cambria, Georgia, Times, “Times New Roman”, serif - p, t
“Century Gothic, “Apple Gothic”, sans-serif - p, t
View noobrecon.sh
#!/bin/bash
####################################
# Config
##################
HTTPROBE_CONCURRENCY=100
HTTPROBE_TIMEOUT=3000
DIRSEARCH_THREADS=50
View cyclic-rotation.markdown

Cyclic Rotation - Array

An array A consisting of N integers is given. Rotation of the array means that each element is shifted right by one index, and the last element of the array is moved to the first place. For example, the rotation of array A = [3, 8, 9, 7, 6] is [6, 3, 8, 9, 7] (elements are shifted right by one index and 6 is moved to the first place).

The goal is to rotate array A K times; that is, each element of A will be shifted to the right K times.

Write a function:

function solution($A, $K);

@gregorynicholas
gregorynicholas / fedtax.js
Created Mar 20, 2020 — forked from Liath/fedtax.js
US Federal Income Tax calculator in javascript
View fedtax.js
// Weekly Employee Income Withholding Calculator by GitHub#Liath
// Based on IRS Circular E - http://www.irs.gov/pub/irs-pdf/p15.pdf
// Per the "Percentage Method"
var w = {
s : { // Single
0 : { p : 0, s : 0 },
44 : { p: 0.1, s: 0 },
222 : { p: 0.15, s: 17.8 },
764 : { p: 0.25, s: 99.1 },
1789 : { p: 0.28, s: 355.35 },
@gregorynicholas
gregorynicholas / github_get_all_forks.sh
Created Mar 19, 2020 — forked from joeytwiddle/github_get_all_forks.sh
Add all forks of the current repo as remotes
View github_get_all_forks.sh
#!/usr/bin/env bash
set -e
# See also: https://github.com/frost-nzcr4/find_forks (same thing but in python)
origin_url="$(git remote show origin | grep 'Fetch URL:' | sed 's+.*: ++')"
full_repo_name="$(echo "$origin_url" | sed 's+.*github.com/++')"
forks_url="https://api.github.com/repos/${full_repo_name}/forks"
View reading.md
@gregorynicholas
gregorynicholas / letor_metrics.py
Created Mar 19, 2020 — forked from mblondel/letor_metrics.py
Learning to rank metrics.
View letor_metrics.py
# (C) Mathieu Blondel, November 2013
# License: BSD 3 clause
import numpy as np
def ranking_precision_score(y_true, y_score, k=10):
"""Precision at rank k
Parameters
View rank_metrics.py
"""Information Retrieval metrics
Useful Resources:
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt
http://www.nii.ac.jp/TechReports/05-014E.pdf
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf
http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf
Learning to Rank for Information Retrieval (Tie-Yan Liu)
"""
import numpy as np
View osx-defaults.sh
#!/usr/bin/env bash
#
# see: https://gist.github.com/gregorynicholas/2160046ec6946a2ce0fa
# src: https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# updated: 2015-06-06
#
# ask for the administrator password upfront
sudo -v
You can’t perform that action at this time.