Skip to content

Instantly share code, notes, and snippets.

View victusfate's full-sized avatar
🚀

Mark Essel victusfate

🚀
View GitHub Profile
{"version":"1.0.1","hasCrew":1,"isSetDefaultCrewSkillValues":0,"isUseStrictRules":1,"shipName":"Fighter X","shipConcept":"Light tough fighter","tierId":"2","frameId":"fighter","powerCoreIds":["pulse-gray"],"thrustersId":"t10","armourId":"mk-8","computerId":"basic-computer","crewQuartersId":"none","defensiveCountermeasuresId":"none","driftEngineId":"signal-basic","expansionBayIds":[],"antiHackingSystemsId":"none","antiPersonnelWeaponId":"none","hasBiometricLocks":false,"computerCountermeasures":{"alarm":false,"fakeShell":false,"feedback":false,"firewall":false,"lockout":false,"shockGridId":"none","wipe":false},"hasSelfDestructSystem":0,"hasDataNet":0,"hasHiveJoining":0,"sensorsId":"budget-short-range","shieldsId":"medium-200","shieldsByPosition":{"forward":50,"aft":50,"port":50,"starboard":50},"weaponMounts":{"forward":[{"weaponId":"coilgun","weight":"light","templateWeight":"light","isFromTemplate":true,"canBeLinked":false,"isLinked":false},{"weaponId":"tactical-nuclear-missile-launcher","weight":"light","tem
@victusfate
victusfate / nearest.sql
Created October 9, 2018 20:01
mysql ellipsoidal query
select st_distance(
point(32.22174290, -110.92647900),
point(places.latitude, places.longitude)
) as distance, places.*
from places
order by distance asc
limit 50
@victusfate
victusfate / pathfinderEncounterGenerator.js
Created September 7, 2018 22:54
pathfinder playtest random encounter generator, to run node pathfinderEncounterGenerator <average_party_level> <party_size>
const aMonstersByLevel = [
[
"Animated broom",
"Beetle, fire",
"Bloodseeker",
"Boar, pig",
"Cat, bobcat",
"Centipede (giant)",
"Dog, guard",
"Goblin warrior",
@victusfate
victusfate / pathfinder_2e_playtest_bestiary.js
Created September 7, 2018 21:38
pathfinder playtest bestiary in js
const level_0 = [
"Animated broom",
"Beetle, fire",
"Bloodseeker",
"Boar, pig",
"Cat, bobcat",
"Centipede (giant)",
"Dog, guard",
"Goblin warrior",
"Halfling footpad",
@victusfate
victusfate / perturbLatLon.js
Last active May 1, 2018 19:26
perturb lat,lon by fixed radius, added example for php nerds
const geolib = require('geolib')
// https://gis.stackexchange.com/questions/25877/generating-random-locations-nearby
const perturbedLatLon = (lat,lon,deltaM) => {
const r = deltaM/111300 // = 100 meters
const y0 = lat
const x0 = lon
const u = Math.random()
const v = Math.random()
const w = r * Math.sqrt(u)
@victusfate
victusfate / multi.js
Last active April 20, 2018 14:33
AD&D 1e magic item stats reroller (sample)
function btw(start,val,end) {
return val >= start && val <= end;
}
function randomInteger(val) {
return Math.floor(Math.random()*val)+1;
}
function SwordExtraordinaryPower() {
return "Awesome";
@victusfate
victusfate / brokenScrollState.js
Last active March 29, 2018 15:57
roll20 loss of map scroll after closing a popout character
{
"length": 0,
"prevObject": {
"0": {
"location": {
"href": "https://app.roll20.net/editor/",
"ancestorOrigins": {},
"origin": "https://app.roll20.net",
"protocol": "https:",
"host": "app.roll20.net",
@victusfate
victusfate / phpSetupMac.md
Created November 21, 2017 19:07
setup nginx + php 7.1 on mac os high sierra

installed php 7.1 with phpbrew

see https://github.com/phpbrew/phpbrew for installation

install php 7.1 custom stuff

phpbrew install 7.1 +cli +fpm +json +curl +mbstring  +mysql +opcache +readline +xml

I needed to run php-fpm with phpbrew

@victusfate
victusfate / cleanup.js
Created October 20, 2017 16:45
clean up your redis client connections! make a call to this whenever you create a new client
const cleanupClientOnProcessEnd = (options) => {
const sAction = 'cache.cleanupClientOnProcessEnd';
const name = options.name;
let client = options.client;
const killDelayTime = 500;
const killClient = (sType) => {
// console.info({action: `${name}.${sAction}.${sType}.client.quit` });
client.quit();
@victusfate
victusfate / Dockerfile
Last active December 19, 2017 16:55
rocket.chat on zeit.co now
FROM rocketchat/rocket.chat
# needs a mongoinstance - defaults to container linking with alias 'db'
ENV MONGO_URL=mongodb://<user>:<pass>@<your mongo instance url> \
HOME=/tmp \
PORT=3000 \
ROOT_URL=http://localhost:3000 \
Accounts_AvatarStorePath=/app/uploads
EXPOSE 3000