This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3.8 | |
# This script manages 5 related tasks. | |
# 1. creating, setting up, and mounting a new zram device | |
# 2. Creating, and setting up a new cgroup | |
# 3. Creating a detached screen instance in the cgroup (the lifetime of the script is tied to this screen instance) | |
# 4. Flushing idle and incompressible pages to a zram backing device, suspending the screen process as needed. | |
# 5. Cleanly closing down the above if zram has an issue or when the screen terminates on its own. | |
__license__=""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def _exapnd_regex(a, p, out_strings): | |
one = False | |
last = 0 | |
d = p.finditer(a) | |
for e in d: | |
one = True | |
grp = e.group() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python tracebac: | |
<RuntimeError object at 0x15d648> | |
RPython traceback: | |
... | |
Fatal RPython error: | |
js console log: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/tick/TickHandlerServer.java b/src/main/java/micdoodle8/mods/galacticraft/core/tick/TickHandlerServer.java | |
index 4a0b01c..dff3f72 100644 | |
--- a/src/main/java/micdoodle8/mods/galacticraft/core/tick/TickHandlerServer.java | |
+++ b/src/main/java/micdoodle8/mods/galacticraft/core/tick/TickHandlerServer.java | |
@@ -460,7 +460,9 @@ public class TickHandlerServer | |
BlockVec3 changePosition = change.getChangePosition(); | |
if (changePosition != null) | |
{ | |
- world.setBlock(changePosition.x, changePosition.y, changePosition.z, change.getChangeID(), change.getChangeMeta(), 2); | |
+ if (change.validateChange(world.getBlock(changePosition.x, changePosition.y, changePosition.z), world.getBlockMetadata(changePosition.x, changePosition.y, changePosition.z))){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/oxygen/ThreadFindSeal.java b/src/main/java/micdoodle8/mods/galacticraft/core/oxygen/ThreadFindSeal.java | |
index 79c5db7..ed195ec 100644 | |
--- a/src/main/java/micdoodle8/mods/galacticraft/core/oxygen/ThreadFindSeal.java | |
+++ b/src/main/java/micdoodle8/mods/galacticraft/core/oxygen/ThreadFindSeal.java | |
@@ -124,26 +131,42 @@ public class ThreadFindSeal | |
public void check() | |
{ | |
long time1 = System.nanoTime(); | |
this.sealed = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re, sys | |
pattern = re.compile("(function .+\(.*\)\n?|function (\(.*\)\n)?|if (.*\n)?|(elseif) (.*\n)?|while (.*\n)?|end|else|for (.*\n)|\{|\})") | |
f=open(sys.argv[1]) | |
lines=f.readlines() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local component = require("component") | |
local os = require("os") | |
local term = require("term") | |
local gpu = component.gpu | |
if component.isAvailable("colorful_lamp") then | |
local lamp = component.colorful_lamp | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def a(): | |
print "Doing something" | |
yield 1 | |
print "Doing some more" | |
yield 0 | |
def b(): | |
print "Doing something different" | |
yield 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
roll20api.startReading=(function(){ | |
var w = XPCNativeWrapper.unwrap(content.window); | |
var campaignRoot = w.campaign_storage_path; | |
if (!campaignRoot){ | |
alert("Let the page finish loading!"); | |
} | |
roll20api.fb = new w.Firebase(w.FIREBASE_ROOT); | |
var fb=roll20api.fb; | |
roll20api.chat=fb.child(campaignRoot).child('chat'); | |
fb.auth(w.GNTKN,function(authinfo){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function expandAttrStringForID(targetID, str){ | |
var patt = new RegExp('@{[a-z0-9A-Z|]+}','ig'); | |
var matches; | |
var match; | |
var mod; | |
var attr; | |
for (matches=str.match(patt);matches;matches=str.match(patt)){ | |
match=matches[0]; | |
attr=match.replace('@{','').replace('}',''); | |
if (/\|/.test(attr)){ |
NewerOlder