Skip to content

Instantly share code, notes, and snippets.

View lumodon's full-sized avatar
🍃
Looking for work

Liv lumodon

🍃
Looking for work
View GitHub Profile
@lumodon
lumodon / Environment Setup.md
Last active May 8, 2019 23:22
These are installations for environment setup that were hard to debug

This line allows pip install psycopg2 to work

Possible prereq's

brew reinstall openssl

Main line that worked

export LDFLAGS="-L/usr/local/opt/openssl/lib"
Note: added to zshconfig -- as of writing this GIST still haven't added it to universal shell rc git repo

@lumodon
lumodon / getAndRunSelenium.sh
Last active March 21, 2019 21:39
Get selenium standalone running on linux for headless support
#!/bin/sh
# This isn't meant to be run as an ACTUAL shell script -- just a list of instructions
# using shellscript to look nice :)
# replace /home/ubuntu with your home directory
# This will work by default on fresh ubuntu 18 amazon EC2 instance
sudo apt install firefox
wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
tar -xvf geckodriver-v0.24.0-linux64.tar.gz
@lumodon
lumodon / Install.sh
Last active July 19, 2023 15:48
Get firefox onto EC2 Instance for selenium
#!/bin/sh
# Fresh EC2 CentOS instance doesn't include libraries
# required by firefox - this script installs them
# One tar file is left behind - TODO: Glob deletion of tar file (dynamic version file name)
# For now, just navigate to /usr/local and delete the tar file
cd /usr/local
wget https://download.mozilla.org/?product=firefox-latest-ssl&os=linux&lang=en-US
@lumodon
lumodon / instructions.md
Created March 15, 2019 17:52
HTTPS on EC2 with NGINX
  1. sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
  2. sudo systemctl stop nginx
  3. cd /opt/letsencrypt
  4. export LC_ALL="en_US.UTF-8"
  5. export LC_CTYPE="en_US.UTF-8"
  6. ./letsencrypt-auto certonly --standalone --email <your@email.com> -d <domain.com> -d <subdomain.domain.com>
  7. sudo vim /etc/nginx/sites-available/default
  8. use alias nginxconfig previously setup
  9. Setup nginx server with following
@lumodon
lumodon / Autoscroller.js
Created March 7, 2019 20:04
autoscroller up and down
var intA = setInterval(() => {
let direction = 1
if(Date.now() % 6000 <= 3000) {
direction = 1
} else direction = -1
a1.scrollBy(0, direction)
}, 1000/60)
@lumodon
lumodon / RethinkDBManager.js
Created January 15, 2019 02:22
This is a little manager to make querying the rethink db more modular
const rdb = require('rethinkdb')
const path = require('path')
require('dotenv').config({ 'path': path.join(__dirname, '../../config/.env') })
const cn = {
'host': process.env.R_HOST || '127.0.0.1',
'port': process.env.R_PORT || 28015,
// 'database': process.env.R_DB || 'golddrop',
// 'user': process.env.R_USER || 'user',
@lumodon
lumodon / README.md
Created January 4, 2019 01:09
How to setup PostgreSQL and Node server on EC2 instance

Assumes you've already gotten an EC2 instance and have ssh access to it. For instructions on how to do that, look elsewhere (To be added here in the future)

Deployment EC2

Setup PostgreSQL

sudo yum install postgresql postgresql-server
sudo -u postgres psql
@lumodon
lumodon / instructions.md
Last active October 12, 2018 17:11
Windows Reset
  1. Windows Boot recovery disk
  2. Troubleshoot
  3. Command Prompt and Show Extensions with:
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v HideFileExt /t REG_DWORD /d 0 /f
  1. Go back to main screen then Troubleshoot
  2. Install system driver
  3. Cancel and No's
@lumodon
lumodon / ClosureText.js
Created September 19, 2018 18:25
Testing closures, callbacks, asynch timing and capturing of values
var x = {val: 120}
function runIt() {
// var x = 50;
const getPromise = () => new Promise((resolve, reject) => {
const y = x.val
setTimeout(() => {
for(let i = 0; i < 10; i++) { x.val++ }
}, 500)
resolve(() => { console.log('inside: ', y, '|| x: ', x.val) })
})
@lumodon
lumodon / CreateCombatFloatingText.js
Created September 18, 2018 23:09
Combat Floating Text
var generateFloatingCombatText = (text, elementToFloatOver) => {
const MILISECONDS_TO_FLOAT = 11500
const FRAME_RATE = 5
const FLOAT_DISTANCE = 30
const MS_PER_FRAME = 1000/FRAME_RATE
const TOTAL_FRAMES_FOR_ANIMATION = MILISECONDS_TO_FLOAT/MS_PER_FRAME
const startPosition = elementToFloatOver.getBoundingClientRect()