Skip to content

Instantly share code, notes, and snippets.

View bitlather's full-sized avatar

Jun Reiderdai bitlather

View GitHub Profile
#
# FROM: https://aws.amazon.com/blogs/developer/advanced-client-stubbing-in-the-aws-sdk-for-ruby-version-3/
#
require 'rspec'
require 'aws-sdk-s3'
describe "Enhanced Stubbing Example Tests" do
let(:fake_s3) { {} }
let(:client) do
client = Aws::S3::Client.new(stub_responses: true)
# From: https://aws.amazon.com/blogs/developer/advanced-client-stubbing-in-the-aws-sdk-for-ruby-version-3/
RSpec.describe RosterCsvNotifierJob, type: :job do
it "s3 test example" do
bucket = {
"SeededKey" => { body: "Hello!" }
}
s3 = Aws::S3::Client.new(stub_responses: true)
s3.stub_responses(:get_object, -> (context) {
obj = bucket[context.params[:key]]
$ git diff --name-only master my_branch | sort
$ rails new PROJECT_NAME --api --skip-test --skip-active-storage --skip-action-mailer --skip-action-mailbox
function copyToClipboard(str) {
const el = document.createElement('textarea');
el.value = str;
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
};
str = $("h1.title").textContent

Installing An Existing Android Ionic Project on Linux Mint 18 VM

Versions for various software may differ; I'm just including the last ones I used that worked.

Java Development Kit version 8

Note: This may or may not be necessary; I installed this before working on the ionic project so I'm not certain if it was needed.

$ sudo apt-get update 
@bitlather
bitlather / Install Private Repo with NPM.md
Created April 14, 2020 20:13
npm install on private repo

If this fails:

$ npm install https://github.com/transistorsoft/cordova-background-geolocation.git
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t https://github.com/transistorsoft/cordova-background-geolocation.git
npm ERR!
npm ERR! remote: Invalid username or password.
npm ERR! fatal: Authentication failed for 'https://github.com/transistorsoft/cordova-background-geolocation.git/'
npm ERR!
npm ERR! exited with error code: 128

For my comment on https://nikles.it/2020/gamemaker-tutorial/better-moving-platforms/

Note that I have my own scripts for creating/destroying data structures, which help me track leaks. create_list() and unregister_and_destroy_list() won't work for you.

Additionally, I did not include the logic move_platform_y_downwards() and move_platform_y_upwards() because it's a light refactoring of what can be found in the tutorial.

move_platform_y():

/// @param yvel
var _yvel = argument0;

Here's an example "concise log" that's written to a file every time a room loads or I call a function to dump this information:

   # |                                               ROOM |                  MAPS |                 LISTS |                STACKS |                 GRIDS |                QUEUES |            PRIORITIES |                 PATHS |                VBUFFS | 
   1 |           se_initialize_tile_palette_to_color_room | (        )        475 | (        )          9 | (        )          1 | (        )          8 | (        )          0 | (        )          0 | (        )          0 | (        )          0 | 
   2 |                               se_stage_editor_room | (   +1128)       1603 | (    +364)        373 | (      +2)          3 | (    +880)        888 | (      +3)          3 | (        )          0 | (        )          0 | (        )          0 | 
   3 |                                        render_room | (    +114)       1717 | (      -2)        371 | (      -2)          1 |