⌥⌘I | Toggle Developer Tools |
⌥⌘C | Toggle JavaScript Console |
⌥⌘U | Show Source |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jq -r 'group_by(.artistName) | map({msPlayed: map(.msPlayed) | add | (. / 1000 / 3600 * 100) | round | (./100), artistName: .[0].artistName}) | sort_by(-.msPlayed) | .[] | [.msPlayed, .artistName] | @csv' < StreamingHistory0.json | sort -nr > artist_by_ms_played.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: | |
# GITHUB_TOKEN=... ./bitbucket-to-github.sh <bitbucket_username> <bitbucket_repo> [github_username] [github_repo] | |
BITBUCKET_USERNAME="$1" | |
BITBUCKET_REPO="$2" | |
GITHUB_USERNAME="${3:-$1}" | |
GITHUB_REPO="${4:-$2}" |
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"","REPORT_ID","REPORT_ENTRY_KEY","EMPLOYEE_COUNTRY","EMP_ID","EXPENSE_DATE","REPORT_SUBMIT_DATE","LEDGER_EXTRACT_DATE","EXPENSE_AMOUNT_REIMBURSEMENT","EXPENSE_AMOUNT_USD","IS_REIMBURSABLE","VENDOR","PAYMENT_TYPE","REPORT_PURPOSE","EXPENSE_DESC","EXPENSE_LOCATION","EXPENSE_STATE","ISO_COUNTRY_CODE","ISO_COUNTRY_NAME","COST_CENTER","AIRLINE_TICKET_NUMBER","RECEIPT_REQUIRED","RECEIPT_SUBMITTED","RECEIPT_IMAGE_AVAILABLE","RECEIPT_HAS_AFFIDAVIT","VEHICLE_ID","JOB_ID","POLICY_NAME","LOB_ID","ATTENDEE_CNT","APPROVER_ID","APPROVED_FIRST_DATE","SENT_PAYMENT_DATE","IS_PREFERRED_VENDOR","SCHED_DAYS_IN_ADVANCE","TRIP_CLASS_TYPE","DAILY_MEAL_AMT","DAILY_MEAL_CNT","HOTEL_GIFTLIEU_DAY_CNT","MILEAGE_CAR_RENTAL_DAY_IND","MONTHLY_AFFIDAVIT_IND","CASUAL_DRIVER_REPAIRS_IND","MILEAGE_CAR_FUEL_IND","LOAD_TS","BUDGET_CENTER" | |
"1",93648,850718,"Canada",108031,2017-05-15,2017-05-23,2017-05-25,289,210.87,"Business Expense - Reimbursable","Marriott Hotels","Cash","Internal Meeting","Hotel","Toronto","Ontario",124,"Canada","CA754005704 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def match(code, start, reverse=False): | |
count = 0 | |
begin, end = "[", "]" | |
if reverse: | |
begin, end = end, begin | |
search = code[:start][::-1] if reverse else code[start:] | |
for i, c in enumerate(search): | |
if c == begin: | |
count += 1 | |
elif c == end: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Changes ESLint configs from numbers to string enums for better readability. | |
* | |
* e.g. | |
* | |
* indent: 0, | |
* eqeqeq: [1, 'allow-null'], | |
* 'no-param-reassign': [2, { props: true }], | |
* | |
* becomes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function *productHelper(lists, prefix = []) { | |
if (lists.length === 0) { | |
yield []; | |
} else { | |
const [head, ...rest] = lists; | |
for (let item of head) { | |
const newPrefix = prefix.concat(item); | |
if (rest.length) { | |
yield *productHelper(rest, newPrefix); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*globals ActiveXObject*/ | |
// Cross browser Ajax implementation based on | |
// http://toddmotto.com/writing-a-standalone-ajax-xhr-javascript-micro-library/ | |
// https://gist.github.com/Xeoncross/7663273 | |
var encodeParams = function(data, bustCache) { | |
var key, | |
params = []; | |
for (key in data) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var button = $('#sm_hide_event'); | |
var count = 0; | |
$('.rounded_dropdown_item.dropdown_item_widget').each(function(i, e) { | |
var text = $(e).text(); | |
if (text.indexOf('{') >= 0) { | |
$(e).click(); | |
button.click(); | |
count += 1; | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
for f in $(git status -s | grep "UU\|AA" | sed -E 's/(UU|AA) //'); do | |
echo $f | |
TEMP="$f.tmp" | |
cat $f | sed '/>>>>>>>/d' | sed '/<<<<<<</,/=======/d' > $TEMP | |
rm $f | |
mv $TEMP $f | |
done |
NewerOlder