Skip to content

Instantly share code, notes, and snippets.

💭
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Lamp ledlamp

💭
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Block or report user

Report or block ledlamp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ledlamp
ledlamp / wrapper.js
Created May 28, 2019
JPLand Minecraft 1.14.x server wrapper
View wrapper.js
var child_process = require("child_process");
var Discord = require("discord.js");
var discordBot = new Discord.Client();
discordBot.on("error", console.error);
discordBot.login(process.cwd().includes("creative") ? "" : "");
discordBot.on("ready", () => {
discordBot.user.setActivity(process.cwd().includes("creative") ? "creative.mc.jpdld.com" : process.cwd().includes("survival") ? "survival.mc.jpdld.com" : undefined);
});
@ledlamp
ledlamp / untitled.js
Last active May 16, 2019
Copy of Brandon(?!)'s fishing bot from Aug 5, 2016: https://pastebin.com/YT4A1iFH
View untitled.js
var Client = require("../multiplayerpiano/static/Client.js");
var levelup = require("levelup");
var fs = require("fs");
var crypto = require("crypto");
var fish = ["Angelfish", "Arapaima", "Arowana", "Barbel Steed", "Barred Knifejaw", "Bitterling", "Black Bass", "Blowfish", "Blue Marlin", "Bluegill", "Brook Trout", "Butterflyfish", "Can", "Carp", "Catfish", "Char", "Cherry Salmon", "Clownfish", "Coelacanth", "Crawfish", "Crucian Carp", "Dab", "Dace", "Dorado", "Eel", "Football fish", "Freshwater Goby", "Frog", "Gar", "Giant Snakehead", "Giant Trevally", "Goldfish", "Guppy", "Hammerhead Shark", "Horse Mackerel", "Jellyfish", "Key", "Killifish", "King Salmon", "Koi", "Large Bass", "Loach", "Lobster", "Mitten Crab", "Moray Eel", "Napoleonfish", "Neon Tetra", "Nibble Fish", "Oarfish", "Ocean Sunfish", "Octopus", "Olive Flounder", "Pale Chub", "Pike", "Piranha", "Pond Smelt", "Popeyed Goldfish", "Puffer Fish", "Rainbow Trout", "Ray", "Red Snapper", "Ribbon Eel", "Saddled Bichir", "Salmon", "Saw Shark", "Sea Bas
@ledlamp
ledlamp / index.js
Last active Aug 22, 2019
discord.io data collector
View index.js
var fs = require("fs");
fs.appendFileSync("discord.ws.log", "\n\n\n");
var Discord = require("discord.io");
var client = new Discord.Client({
token: require("../config").token,
autorun: true,
messageCacheLimit: 0
});
client.setPresence({status: "invisible"});
@ledlamp
ledlamp / AppTimeCounter.py
Last active May 19, 2019
Count seconds spent in each app each day and write to file
View AppTimeCounter.py
from AppKit import NSWorkspace
import time
from datetime import datetime
date = str(datetime.now().date())
apptimes = {}
try:
while True:
app = NSWorkspace.sharedWorkspace().activeApplication()['NSApplicationName']
@ledlamp
ledlamp / apptimecounter.py
Created May 7, 2019
Mac Python script to count seconds spent per app
View apptimecounter.py
from AppKit import NSWorkspace
import threading
def setInterval(func,time):
e = threading.Event()
while not e.wait(time):
func()
apptimes = {}
@ledlamp
ledlamp / index.js
Last active Mar 23, 2019
Node.js process wrapper
View index.js
var child_process = require("child_process");
var exampleProcess = child_process.spawn("java", ["-jar", "server.jar"]);
exampleProcess.stdout.pipe(process.stdout); // pipe child process output to parent stdout so you get console output as normal
exampleProcess.stdout.on('data', (data) => {
require("fs").appendFileSync("output.txt", data); // programatically do something with the output
});
exampleProcess.stderr.pipe(process.stderr); // ditto for standard error
@ledlamp
ledlamp / install-pkg
Created Mar 18, 2019
/usr/bin/install-pkg from repl.it "ploygott" 🤔
View install-pkg
#!/usr/bin/env bash
# bin/compile <build-dir> <cache-dir>
# fail fast
set -e
# debug
# set -x
# parse and derive params
@ledlamp
ledlamp / .js
Last active Feb 10, 2019
draw image on mpp.terrium.net
View .js
function getRandomColor() {
var letters = '0123456789ABCDEF';
var color = '#';
for (var i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
function drawPixel(x, y, color) {
View asd.js
let pks = `a1
b1
c2
d2
e2
f2
g2
a2
b2
c3
View reverse-ws-proxy.js
var http = require('http');
var httpProxy = require('http-proxy');
var express = require('express');
var app = express();
var proxy = httpProxy.createProxyServer();
var server = require('http').createServer(app);
app.get('/', function(req, res) {
try {
You can’t perform that action at this time.