Skip to content

Instantly share code, notes, and snippets.

View raineorshine's full-sized avatar

Raine Revere raineorshine

  • New York, NY
View GitHub Profile
@raineorshine
raineorshine / firebase.js
Created July 21, 2022 11:16
Firebase v4.12.1
// https://cdn.jsdelivr.net/npm/firebase@4.12.1/firebase.js
/*!
* @license Firebase v4.12.1
* Build: rev-5cfbafd
* Terms: https://firebase.google.com/terms/
*/
var firebase=function(){var e=void 0===e?self:e;return function(t){function r(e){if(o[e])return o[e].exports;var n=o[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,r),n.l=!0,n.exports}var n=e.webpackJsonpFirebase;e.webpackJsonpFirebase=function(e,o,a){for(var c,s,u,f=0,l=[];f<e.length;f++)s=e[f],i[s]&&l.push(i[s][0]),i[s]=0;for(c in o)Object.prototype.hasOwnProperty.call(o,c)&&(t[c]=o[c]);for(n&&n(e,o,a);l.length;)l.shift()();if(a)for(f=0;f<a.length;f++)u=r(r.s=a[f]);return u};var o={},i={6:0};return r.m=t,r.c=o,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r.oe=function(e){throw console.error(e),e}
@raineorshine
raineorshine / mongo-cheat-sheet.js
Last active July 7, 2022 20:22
Cheat Sheet: MongoDB
/* COMMAND LINE */
mongod & // start mongo server on port 27017 by default
mongo mydb // launch mongo shell using the specified database
// importing & exporting
mongoimport -d mydb -c mycollection --jsonArray --file input.json
mongoimport -d mydb -c mycollection --headerline --type csv --file input.csv
mongoexport -d mydb -c mycollection --out output.json
/* MONGO SHELL */
@raineorshine
raineorshine / webcolors.json
Created April 10, 2014 15:29
140 Web Colors with name, hex, and rgb in JSON format, roughly ordered by hue.
[{
"name": "Lavender",
"hex": "E6E6FA",
"rgb": { "r": 230, "g": 230, "b": 250 }
},
{
"name": "Thistle",
"hex": "D8BFD8",
"rgb": { "r": 216, "g": 191, "b": 216 }
},
@raineorshine
raineorshine / output.sh
Last active December 6, 2021 15:03
Browserstack verbose test output
Run yarn test:ios
yarn run v1.22.11
$ react-scripts test ./src/e2e/iOS --verbose
Setup Test Environment for webdriverio.
Using the currently running app on http://localhost:3000
2021-09-13T19:29:20.250Z INFO webdriver: Initiate new session using the WebDriver protocol
2021-09-13T19:29:20.251Z INFO webdriver: [POST] hub.browserstack.com/wd/hub/session
2021-09-13T19:29:20.251Z INFO webdriver: DATA {
capabilities: {
alwaysMatch: {
@raineorshine
raineorshine / memrise-export.js
Last active December 1, 2021 17:02
Export Memrise course words to CSV. There is also a Chrome Extension: https://chrome.google.com/webstore/detail/memrise-export/hcllgkpmoiolndnhmbdceffaidjmkoam
/*
UPDATE: This is now a Chrome Extension: https://chrome.google.com/webstore/detail/memrise-export/hcllgkpmoiolndnhmbdceffaidjmkoam
Source Code: https://github.com/raineorshine/memrise-export
Export Memrise course words to CSV (technically TSV, or "tab separated file", but it is effectively the same).
1. Log into Memrise.
2. Navigate to the course page you would like to export (e.g. https://app.memrise.com/course/2156672/german-random-01/).
3. Open the browser's Developer Console (https://support.airtable.com/hc/en-us/articles/232313848-How-to-open-the-developer-console)
@raineorshine
raineorshine / mysql-troubleshooting.md
Last active November 12, 2021 17:22
Installing MySQL is the worst

Installing MySQL is the worst

Install

Use MariaDB.

MySQL community edition had permissons issued with mysqld.

brew update
@raineorshine
raineorshine / refined-github.css
Last active November 22, 2020 19:54
Custom CSS for my Refined GitHub
/* https://github.com/sindresorhus/refined-github */
/* conflict marker positioning */
.rgh-conflict-marker { margin-left: 5px !important; margin-right: 0 !important }
/* everhour start icon */
.js-issue-row .everhour.start { display: none !important; }
/* reset row size */
.js-issue-row .text-small.text-gray { line-height: inherit; !important }
@raineorshine
raineorshine / or.js
Created November 11, 2020 19:25
Functional programming "or" in Javascript
/*
An "or" function is a higher-order function that composes multiple predicates into one,
such that the composed predicate will return true if at least one of the predicates
returns true for the given argument. (A predicate is a function that returns `boolean`.)
e.g.
const isEven = n => n%2 === 0
const isPositive = n => n > 0
// un-fancy
@raineorshine
raineorshine / _sublime-cheat-sheet.md
Last active October 26, 2020 08:05
Sublime Cheat Sheet

Selection and Navigation

⌘D                Multi-select
⌘K,⌘D             Skip the current match and select the next one
⌘U                Soft Undo
⌘ + Ctrl + G      Select all occurences under cursor
⌘P                Jump to files
⌘L                Select Line
⌘ + Shift + L     Convert Selection to Multi-select

⌘ + Shift + J Select all lines at current indentation

@raineorshine
raineorshine / MyContract.sol
Last active August 18, 2020 06:19
Generate an AST for an Ethereum Solidity contract with the solidity-parser module.
contract MyContract {
uint counter = 0;
function Count() {
counter++;
}
function CallCount() {
Count();
}