Skip to content

Instantly share code, notes, and snippets.

@paxperscientiam
paxperscientiam / scene.ts
Created June 17, 2023 19:27
Integrating ThreeJS objects with orthographic camera tracking
import * as THREE from 'three'
window.THREE = THREE
import { GameObjects, Scene, Sound, Tilemaps, Geom, Math as PMath } from "phaser";
import { Controller, Controls} from 'controls';
import BaseLayer from "@layers/base"
@paxperscientiam
paxperscientiam / Fortune-1000-Company-Twitter-Accounts.csv
Created October 29, 2022 07:08 — forked from mbejda/Fortune-1000-Company-Twitter-Accounts.csv
Fortune 1000 companies Twitter Accounts. Twitter,domain, keywords, and description
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 5.
domain,name,keywords,description,twitter
walmartstores.com,Wal-Mart Stores,"SEC filing,Walmart photos,walmart stock,sustainability index,Wal-Mart,walmart annual reports,Walmart responsibility,executive speeches,walmart suppliers,global responsibility,walmart global sustainability report,walmart investors,Walmart interactive map,walmart history,privacy policy,financial reports,walmart news,Wal Mart,walmart sustainability,Walmart locations,Walmart videos,walmart story,Walmart,Walmart stores,walmart board of directors,community giving,walmart careers,Walmart jobs,sam walton","Find Walmart executive speeches, financial reports, press releases, downloadable photos and videos, and see an interactive map of our locations around the world.",walmart
gm.com,General Motors,,"General Motors is home to Buick, Cadillac, GMC and Chevrolet. Find the latest news about GM automotive innovations, investor relations and more. ",GM
ge.com,General Electric,,,generalelectric
chevron.com,ChevronTexaco,"cvx, chevrontexaco, cheveron,
@paxperscientiam
paxperscientiam / Relative Row
Created February 15, 2022 05:12
Compute relative row in Excel
# v. 1.0
# Originally posted here: https://www.reddit.com/r/excel/comments/339gw7/discussion_simplest_possible_way_to_get_this/
# Use at your own discretion.
# Pax Per Scientiam
This is pretty much ripped directly from a posting I made on Reddit. I'm putting it here for posterity. Please note that I'm using the Excel 2011 (Mac) version of structured reference syntax, which I think is a bit different than that of Excel 2013 (Windows).
I've long wondered if there were a simpler way to get the relative row number of an Excel Table.
This has been my usual go to (refers to some table called "Table1" and some column therein called "column1"),which is entered into column1:
@paxperscientiam
paxperscientiam / Useful Excel WS formulae.txt
Last active February 15, 2022 05:11
Useful Excel WS formulae
' Useful Excel Worksheet formulas
' This is a living paste...stay tuned for more
' Unless otherwise state, assume Excel Table structured reference syntax.
' Whole Number Sequence
= [@counter] = 1+ROW()-ROW([counter])
' Fixed-Divisor Modulo Numeric Cycle
' Reference: http://www.bennadel.com/blog/2240-creating-repeated-sequences-with-the-modulus-mod-operator.htm
@paxperscientiam
paxperscientiam / migration.php
Created April 30, 2021 03:59 — forked from jaceju/migration.php
Use Laravel Migration standalone
<?php
use Illuminate\Container\Container;
use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Database\ConnectionResolverInterface;
use Illuminate\Database\Migrations\DatabaseMigrationRepository;
use Illuminate\Database\Migrations\MigrationRepositoryInterface;
use Illuminate\Database\Migrations\Migrator;
use Illuminate\Events\Dispatcher;
@paxperscientiam
paxperscientiam / array_extend_recursive.md
Created August 3, 2020 15:13 — forked from adrian-enspired/array_extend_recursive.md
array_merge|replace_recursive are frustrating.

say you have two arrays, $a1 and $a2, and you want to combine them.

<?php

$a1 = [
  'a' => 'foo',
  'b' => ['bar']
];
$a2 = [
  'a' => 'bar',
@paxperscientiam
paxperscientiam / low-battery.bash
Created February 22, 2020 20:50
macos low battery notifications (cron)
#!/usr/bin/env bash
declare -x GEM_HOME=/usr/local/ruby-lang/Gems
declare -x GEM_PATH=/usr/local/ruby-lang/Gems
if pmset -g batt | grep -Eo "Battery Power"
then
x=$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1) && [[ $x -lt 50 ]] && /usr/local/ruby-lang/Gems/bin/terminal-notifier -ignoreDnD -title "battery status" -message "low battery (${x}%)"
fi
@paxperscientiam
paxperscientiam / tmux-xpanes-implementation-example.bash
Created February 14, 2020 18:20
tmux-xpanes-implementation-example.bash
#!/usr/bin/env bash
unset CDPATH
PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/opt/local/bin
function title ()
{
echo -ne "\033]0;"$*"\007"
const path = require('path');
function Req(base) {
this.base = base;
}
Req.prototype.get = function(module, opts) {
if (typeof require(path.resolve(this.base, module)) === 'function' && opts !== undefined) {
return require(path.resolve(this.base, module))(opts)
} else {
GIF89aYw!ÿ NETSCAPE2.0!ù9,Y‡

     +!.4&%$)!*#.16" 5&;4:2*(#(,4+2)$894+#3.293(3325D%:C0,B7<D87U)B;>B.9C;8Q?+CG,FS8FK;IR8QK:SV;TcBJ+A-"E8(D<4T;&S>2k7i<#C9@NMJB+HD8OX$JQ;WE)UH8XY%ZT:WeZc*oBkS5pj7GHFCLTKRJITYTLERNSWUHTZZHKjJYbF[pT\bV[vZb[KdgLfrZcdWjtYqm[sxfZJb^eidIgeXlp[yhGujWzuGzsYeigflqkqkjttsldslpvuivzv[r‚gmƒhy„j}•w|„u}™vx¡|€;~D{yjƒˆlˆ—z„…uŠ—y’Žx’šz—®} ¹=ƒ=!ƒD‹R*Ži8¢\*¯l2…\AˆuR†zk§zKÇz7€~…„<±>•…Y‰ƒh‡…xŽ’{˜‡e•Šwœ“f™’y§[¬•j¸¢[¸£r΅;͓KŜlÓ§Pɬvç°Uå³oØÌ\ÛÃxïÎ_éÌrùí{‡‰…‡Œ•Œ‘‰‰”–”Œƒ“Ž“–•ˆ—™–ƒ‹¨…›ªƒ³”œ¦•žºŒ¡›› ‹œ¡™Š¡¬ˆ£·™¤¨”¨·™°¹¥›ˆ¨¢Š§¥—­°›·§‡²¬˜»±‰¸²›§©¦¤«´«²¨¨µ¸²­¤±®º¶¶¨·¸¶®Ã¢¨Âª¹Ä©¼Ô³¼Ä±»Ó»Á¹žÂÑ«Â̧ÇÖ®ÑÛ¶ÆɸÊÔ¼ÑÉ»ÑÙ¶Ûé½áíζˆÂ¼©å»‡ØÎËǵÝä¸é̐éدóæ”õé´ÈÉÆÄÍÓÌÒÊÅÕÛÑÎÄÓÎÑÖÕÉÜÜÛÌÛâÚâØÆæíÈéòÎðôØåæÑíòÐðïÔñôâÜÍâÞáïíÓååååíðêòëêóòðîåðîò÷÷éôôôÿñ H° Áƒ*\È°¡Ã‡#JœH±¢Å‹3jÜȑà¿A~Ä÷Qdɓ(Sª\ɲ¥Ë—0cʜI³¦Í›8sêÜɳ§ÏŸ@ƒ
js`I’#U8ò H†O;JJ•áºªX³jÝʵkÁ¦^ÊK¶¬Ù³h¡Œ*ðiʶ-áK·®Ý»xóêÝË·¯_ HC~ûµ¡È´ˆ+^̸1GŽ#KžL¹òbÈÝ¢”ËéßÏ C‹Mº´éÓAá†Ä¼–ma£–c˞M»