Skip to content

Instantly share code, notes, and snippets.

Avatar
💀
alter.

gregory nicholas gregorynicholas

💀
alter.
View GitHub Profile
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
@gregorynicholas
gregorynicholas / GCalUtils.md
Created Nov 17, 2019 — forked from mogsdad/GCalUtils.md
Collection of Google Calendar related utility functions for Google Apps Script.
View GCalUtils.md

Google Calendar Utilities

getEventsWithGuest

Gets all events that occur within a given time range, and that include the specified guest email in the guest list.

###Parameters:###

@gregorynicholas
gregorynicholas / convertSheet2Json.gs
Created Nov 17, 2019 — forked from daichan4649/convertSheet2Json.gs
spreadsheet のデータを JSON として読み込む(Google Apps Script)
View convertSheet2Json.gs
function convertSheet2Json(sheet) {
// first line(title)
var firstRange = sheet.getRange(1, 1, 1, sheet.getLastColumn());
var firstRowValues = firstRange.getValues();
var titleColumns = firstRowValues[0];
// after the second line(data)
var lastRow = sheet.getLastRow();
var rowValues = [];
for(var rowIndex=2; rowIndex<=lastRow; rowIndex++) {
@gregorynicholas
gregorynicholas / pullJSON.js
Created Nov 17, 2019 — forked from varun-raj/pullJSON.js
Google App Script To Fetch Data From JSON Webservice and Write them to google spreadsheet.
View pullJSON.js
function pullJSON() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheets = ss.getSheets();
var sheet = ss.getActiveSheet();
var url="http://example.com/feeds?type=json"; // Paste your JSON URL here
var response = UrlFetchApp.fetch(url); // get feed
var dataAll = JSON.parse(response.getContentText()); //
You can’t perform that action at this time.