Skip to content

Instantly share code, notes, and snippets.

View ChaelCodes's full-sized avatar

Rachael Wright-Munn ChaelCodes

View GitHub Profile
@ChaelCodes
ChaelCodes / Kill Unterminated Rails Server
Created August 8, 2019 12:59
Kill Unterminated Rails Server
lsof -wni tcp:3000
kill -9 <pid>
{
"binary_file_patterns":
[
"generated/*",
"*.tbz2",
"*.gzip",
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false
-----> Installing binaries
@ChaelCodes
ChaelCodes / autoHack.js
Last active November 29, 2020 19:37
Server Status Dashboard for BitBurner
import { networkTraversal } from '/scripts/networkTraversal.js';
export async function main(ns) {
let home = ns.getHostname();
networkTraversal(ns, home, home, crackAndHack);
}
function crackAndHack(ns, targetServer, originServer) {
if (!ns.hasRootAccess(targetServer) && hackableServer(ns, targetServer)) {
crackServer(ns, targetServer);
body {
background-color: rgba(255, 0, 0, 100);
}
@ChaelCodes
ChaelCodes / rails_41986.rb
Created April 25, 2021 16:19
Rails #41986 Reproduction
# frozen_string_literal: true
# In a many-to-many relationship, when setting values using
# ids, and nested_attributes, if the attributes come first,
# they are overriden by the ids. If the ids come first, the
# attributes are included too!
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
class Game
attr_gtk
def tick
defaults
render
input
calc
end
# ZggkdvW9k9kkLFCl3g0
print "what's 5x5?"
print "25"
# PulgaMechanica
print "Hi Chael, what u up to?"
ptiny "LI am celebtaying my 2nd streamiversary! Folks may remember when I reviewed the Kinesis on stream, and I did a blindfolded Q&A while I was learning touch-tuping!"
# JonSugar
print "chael, is Ruby dead?"
@ChaelCodes
ChaelCodes / currying.js
Last active September 8, 2021 22:35
When you curry a function, you can skip arguments when calling the function. Curry will wait until all arguments are present to attempt calling the function. This lets you define functions that supply an argument or two, and then call those functions with the rest of the arguments later.
// The function is curried, so we can skip a or b
const add = curry((a, b) => a + b);
// These functions use a curried function, so you can skip an argument
const increment = add(1);
const addTen = add(10);
// The function is now called because the second argument is supplied
addTen(5); // returns 15
increment(3); // returns 4
@ChaelCodes
ChaelCodes / build.log
Created October 10, 2022 17:58
Log from failing CASA build
Removing network casa_default
Network casa_default not found.
Removing volume casa_db_data
Volume casa_db_data not found.
###########################
BEGIN: docker-compose build
###########################
database uses an image, skipping
selenium_chrome uses an image, skipping
Building web