Skip to content

Instantly share code, notes, and snippets.

View greg-1-anderson's full-sized avatar

Greg Anderson greg-1-anderson

View GitHub Profile
@greg-1-anderson
greg-1-anderson / Byron Skyblock script
Created March 9, 2022 05:23
Script with skyblock calculations
<?php
$lapis1=8937;
$lapis3=9600;
$lapis5=10367;
$lapis7=11269;
$lapis9=12342;
$lapis11=14400;
$lapis1c=256;
@greg-1-anderson
greg-1-anderson / TestTrait.php
Created October 4, 2019 03:33
Example of trait with private
<?php
trait TestTrait
{
private $foo;
protected function upFoo()
{
$this->foo++;
@greg-1-anderson
greg-1-anderson / ShouldHaveMadeTheEye.sgf
Created April 14, 2018 16:44
Three-stone handicap game on Nashville -> SF flight
(;GM[1]FF[4]CA[UTF-8]AP[WebGoBoard:0.10.11]ST[2]SZ[19]KM[0]HA[3]PB[Black]PW[White]AB[pp][dp][pd];B[];W[dd];B[qq];W[jp];B[cq];W[gq];B[cj];W[jd];B[qj];W[nc];B[pb];W[cg];B[pg];W[nq];B[oq];W[np];B[pm];W[cm];B[dm];W[dl];B[cl];W[el];B[cn];W[bm];B[dn];W[ck];B[bl];W[bk];B[bn];W[al];B[ne];W[md];B[me];W[nm];B[ol];W[er];B[dr];W[le];B[nk];W[lf];B[lk];W[gn];B[jl];W[ml];B[mk];W[kl];B[kk];W[jk];B[ll];W[km];B[lm];W[kn];B[mn];W[ik];B[nn];W[oo];B[po];W[ln];B[on];W[ji];B[li];W[kh];B[lh];W[lg];B[ng];W[mh];B[mg];W[lj];B[kj];W[ki];B[mj];W[im];B[jj];W[ij];B[kg];W[jg];B[kf];W[qc];B[pc];W[re];B[qd];W[rd];B[qb];W[rh];B[ri];W[qg];B[qh];W[rg];B[qf];W[rf];B[rc];W[dc];B[jf];W[if];B[ig];W[ii];B[ie];W[hf];B[je];W[hd];B[he];W[id];B[ld];W[kd];B[lc];W[ke];B[ge];W[hg];B[kc];W[jc];B[gd];W[mc];B[hc];W[kb];B[lb];W[mb];B[jb];W[la];B[ib];W[fc];B[gc];W[gb];B[hb];W[fb];B[ih];W[jh];B[hh];W[gh];B[gg];W[hi];B[gf];W[fh];B[fg];W[eg];B[ef];W[df];B[ee];W[dg];B[ga];W[ha];B[ia];W[fa];B[nd];W[nr];B[or];W[fq];B[eq];W[fr];B[fo];W[go];B[fn];W[fm];B[fp];W[an];B[ao]
@greg-1-anderson
greg-1-anderson / lock-all-environments
Last active November 12, 2021 20:52
Lock all of the environments for the given site, save for the live environment
#!/bin/bash
SITE=$1
USER=${2-demo}
PASSWORD=${3-secretsecret}
ALL_ENVS="$(terminus env:list $SITE --field=id | grep -v live)"
for ENV in $ALL_ENVS ; do
is_locked="$(terminus lock:info "$SITE.$ENV" --field=locked)"
2016
5. https://pantheon.io/blog/turn-twig-debug-mode-drupal-8-pantheon
4. https://pantheon.io/blog/dont-fear-1-0-rational-project-management-libraries-using-semver
3. https://pantheon.io/blog/modern-command-line-tools-drupal-modules-drush-and-drupal-console
2. https://pantheon.io/blog/trouble-two-autoloaders
1. https://pantheon.io/blog/gentoos-composer-problem
2015
#!/bin/bash
#
# Add the ssh key for the specified Pantheon site and environment
# to the user's known_hosts file.
#
# See: http://serverfault.com/questions/132970/can-i-automatically-add-a-new-host-to-known-hosts
#
# Note that this script does not remove and re-add the ssh keys;
# if you want to do that, you might as well just use -o StrictHostKeyChecking=no.
@greg-1-anderson
greg-1-anderson / keybase.md
Created July 26, 2016 18:53
Keybase identity verification

Keybase proof

I hereby claim:

  • I am greg-1-anderson on github.
  • I am greg1anderson (https://keybase.io/greg1anderson) on keybase.
  • I have a public key whose fingerprint is 5345 348A BEC7 B3DD ADBB F996 2850 D252 D5F5 25A6

To claim this, I am signing this object:

@greg-1-anderson
greg-1-anderson / fastcgi_params
Created November 18, 2015 19:20
fastcgi_param for Pantheon
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
@greg-1-anderson
greg-1-anderson / btool-converge.log
Last active November 17, 2015 20:28
btool converge -s
$ btool converge -s
Converging on the command line is dangerous since it does not check if a converge is in progress in jenkins. Are you sure you don't want to run converge within jenkins?
Please confirm that you want to do this (yes/no). yes
Converging site 180788fb-b5ce-4dd3-9b9e-1cccdff62c20 environment dev
{"max_bindings": "", "run_list": ["recipe[endpoint::bindings]"], "binding_id": "3e13d6e5ab8d4c5db2f9f26c75432625"}
/tmp/1447792009.22_3e13d6e5ab8d4c5db2f9f26c75432625_bindings.json
Starting Chef Client, version 12.4.1
Compiling Cookbooks...
Recipe: chef_handler::default
* remote_directory[/var/chef/handlers] action create
$ phpunit -c core --filter UnroutedUrlAssemblerTest
PHPUnit 4.8.11 by Sebastian Bergmann and contributors.
.....................FF..
Time: 5.63 seconds, Memory: 144.75Mb
There were 2 failures:
1) Drupal\Tests\Core\Utility\UnroutedUrlAssemblerTest::testAssembleWithLocalUri with data set #11 ('base:core/authorize.php', array(), false, 'core/authorize.php', '/core/authorize.php')