Skip to content

Instantly share code, notes, and snippets.

@kalenpw
kalenpw / fetch_server_jar.py
Created Aug 12, 2022
Downloads most recent server.jar for Minecraft
View fetch_server_jar.py
import urllib.request, json
with urllib.request.urlopen("https://launchermeta.mojang.com/mc/game/version_manifest.json") as manifest_url:
manifest_data = json.loads(manifest_url.read().decode())
current_url = manifest_data['versions'][0]['url']
with urllib.request.urlopen(current_url) as current_url:
current_data = json.loads(current_url.read().decode())
jar_url = current_data['downloads']['server']['url']
@kalenpw
kalenpw / oh-my-zsh .zshrc
Last active Jan 10, 2022
oh-my-zsh .zshrc
View oh-my-zsh .zshrc
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH:
# Path to your oh-my-zsh installation.
export ZSH="/Users/myusername/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
@kalenpw
kalenpw / ulauncher.log
Created May 17, 2020
Debug output for bug report
View ulauncher.log
➜ ~ ulauncher -v
2020-05-17 08:27:58,193 | INFO | ulauncher: main() | Ulauncher version 5.7.5
2020-05-17 08:27:58,193 | INFO | ulauncher: main() | Extension API version 2.0.0
2020-05-17 08:27:58,193 | INFO | ulauncher: main() | GTK+ 3.22.30
2020-05-17 08:27:58,193 | INFO | ulauncher: main() | Is Wayland: False
2020-05-17 08:27:58,194 | INFO | ulauncher: main() | Wayland compatibility: off
2020-05-17 08:27:58,210 | DEBUG | ulauncher.ui.windows.Builder: __init__() | consider using a pythonic name instead of design name 'input-box'
2020-05-17 08:27:58,213 | DEBUG | ulauncher.ui.windows.Builder: do_connect() | connect builder by name 'ulauncher_window','destroy', 'on_destroy'
2020-05-17 08:27:58,214 | DEBUG | ulauncher.ui.windows.Builder: do_connect() | connect builder by name 'ulauncher_window','focus_in_event', 'on_focus_in_event'
2020-05-17 08:27:58,214 | DEBUG | ulauncher.ui.windows.Builder: do_connect() | connect builder by name 'ulauncher_window','focus_out_event', 'on_focus_out_event'
View TaskList.js
import React from 'react';
import Task from "./Task.js";
import NewTask from "./NewTask";
import styled from 'styled-components';
const TasksList = styled.ul`
li{
padding: 1px;
View server.c
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <pthread.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#define Cache_Size 5