Skip to content

Instantly share code, notes, and snippets.

View Cheejyg's full-sized avatar
🏠
Working from home

Cheejyg Cheejyg

🏠
Working from home
View GitHub Profile
@Cheejyg
Cheejyg / gist:a1698dde4848949ae84b7ce60c8cc396
Created December 16, 2021 05:12
Photoshop: Black alpha background to transparent image
1. Duplicate layer
2. With the upper layer selected, Image > Adjustments > Black & White > Preset: Lighter > Ok
3. Select All > Cut
4. Select lower layer
5. Add layer mask
6. Alt + Click layer mask
7. Paste
8. Right Click layer mask > Apply Layer Mask
function getMultiple_FILES() {
$_FILE = array();
foreach($_FILES as $name => $file) {
foreach($file as $property => $keys) {
foreach($keys as $key => $value) {
$_FILE[$name][$key][$property] = $value;
}
}
}
return $_FILE;
import json
inputFilename = input("File: ")
with open(inputFilename, "rt") as input_file:
inputs = json.load(input_file)
source = ""
for x in range(len(inputs["cells"])):
for string in inputs["cells"][x]["source"]:
/*
* robot.js
*
* You'll need three keys in order to unlock the
* Algorithm: the red key, the green key, and the
* blue key. Unfortunately, all three of them are
* behind human-proof barriers.
*
* The plan is simple: reprogram the maintenance
* robots to grab the key and bring it through
/*************
* ambush.js *
*************
*
* Oh. Oh, I see. This wasn't quite part of the plan.
*
* Looks like they won't let you take the Algorithm
* without a fight. You'll need to carefully weave your
* way through the guard drones.
*
/**********************
* fordingTheRiver.js *
**********************
*
* And there's the river. Fortunately, I was prepared for this.
* See the raft on the other side?
*
* Everything is going according to plan.
*/
/*******************
* intoTheWoods.js *
*******************
*
* Ah, you're out of the woods now. Or into the woods, as the
* case may be.
*
* So take a deep breath, relax, and remember what you're here
* for in the first place.
*
/*************
* colors.js *
*************
*
* You're almost at the exit. You just need to get past this
* color lock.
*
* Changing your environment is no longer enough. You must
* learn to change yourself. I've sent you a little something
* that should help with that.
/****************
* drones101.js *
****************
*
* Do you remember, my dear Professor, a certain introductory
* computational rationality class you taught long ago? Assignment
* #2, behavior functions of autonomous agents? I remember that one
* fondly - but attack drones are so much easier to reason about
* when they're not staring you in the face, I would imagine!
/******************
* minesweeper.js *
******************
*
* So much for Asimov's Laws. They're actually trying to kill
* you now. Not to be alarmist, but the floor is littered
* with mines. Rushing for the exit blindly may be unwise.
* I need you alive, after all.
*
* If only there was some way you could track the positions