Skip to content

Instantly share code, notes, and snippets.

View WalshyDev's full-sized avatar

Daniel Walsh WalshyDev

View GitHub Profile
@WalshyDev
WalshyDev / do_not_ban_list.log
Created October 6, 2021 11:26
Do not ban list (log)
{"time":1427504758,"action":"add","action_by":"Commanderroot","username":"commanderroot","reason":"admin"}
{"time":1427504946,"action":"add","action_by":"Commanderroot","username":"livectf","reason":"non-gaming"}
{"time":1427504962,"action":"add","action_by":"Commanderroot","username":"channelfireballtesting","reason":"non-gaming"}
{"time":1427504970,"action":"add","action_by":"Commanderroot","username":"csawctf","reason":"non-gaming"}
{"time":1427504978,"action":"add","action_by":"Commanderroot","username":"cemdrexmc","reason":"underage"}
{"time":1427504988,"action":"add","action_by":"Commanderroot","username":"luckhorses123","reason":"underage"}
{"time":1427504997,"action":"add","action_by":"Commanderroot","username":"procjam","reason":"Game dev talk"}
{"time":1427505008,"action":"add","action_by":"Commanderroot","username":"exag14","reason":"Game dev talk"}
{"time":1427505018,"action":"add","action_by":"Commanderroot","username":"pokerstars","reason":"Poker is fine"}
{"time":1427505029,"action":"add","acti
@WalshyDev
WalshyDev / do_not_ban_list.json
Created October 6, 2021 11:25
Do not ban list (JSON)
{
"317070": {
"reason": "non-gaming \\/ non-creative",
"added_at": 1435174076,
"added_by": "Rkennedy"
},
"commanderroot": {
"reason": "admin",
"added_at": 1427504758,
"added_by": "Commanderroot"
@WalshyDev
WalshyDev / gist:65d333e5320b9df20bc09bb5b6015ee7
Created May 3, 2020 03:25
Finding a quick String split
The pursuit of a quick way to split a string!!
Test 1: Compiled pattern running split(String)
Test 2: String -> char array -> building string -> adding to list on split char
Test 3: Some internal Java code I nabbed! Thanks OpenJDK!
```
Test 1 took: 933ms (1071811.3612 ops/s)
Test 2 took: 782ms (1278772.3785 ops/s)
Test 3 took: 310ms (3225806.4516 ops/s)
@WalshyDev
WalshyDev / Micro-optimizations.md
Last active May 6, 2022 12:27
Java Micro-optimization Tests

Some micro-optimizations I tested. These were all ran on the same hardware, your timings may differ but the result should always be the same.

Checking if string has a char

Test

final String s = "This is some string because I'm crazy and need to micro-optimise ok? STOP JUDGING ME!";

TestTimer.testSnippet(1_000_000,
    () -> { boolean found = s.indexOf('-') != -1; },
    () -> { boolean found = s.contains("-"); }

Keybase proof

I hereby claim:

  • I am walshydev on github.
  • I am walshy (https://keybase.io/walshy) on keybase.
  • I have a public key ASBzqzqyhTqZ3WuBl4mLvcere0lo0baCw1fGICVviYK7LQo

To claim this, I am signing this object:

<!-- Put this in your resources folder! -->
<configuration>
<appender name="Log" class="ch.qos.logback.core.FileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<file>./latest.log</file>
<encoder>
<pattern>[%d{yyyy.MM.dd HH:mm}] [%level] [%logger{0}] [%t] %msg%n</pattern>
import psutil;
print(psutil.cpu_percent(interval=1))
print(psutil.virtual_memory())
print(psutil.swap_memory())
### FlareBot Individual Contributor License Agreement
Thank you for your interest in contributing to open source software projects (“Projects”) made available by Daniel Walsh SE or its affiliates (“Daniel Walsh”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to Daniel Walsh in respect of any of the Projects (collectively “Contributions”).
You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.
**Copyright License.** You hereby grant, and agree to grant, to Daniel Walsh a non-exclusive, perpetual, irrevocable, worldwide, fully-paid, royalty-free, transferable copyr

Keybase proof

I hereby claim:

  • I am walshydev on github.
  • I am bwfcwalshy (https://keybase.io/bwfcwalshy) on keybase.
  • I have a public key ASBTVVRTtfEa92ci4uKxVBAfX7poInccgStQuAAVyNiE4wo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am bwfcwalshyplugindev on github.
  • I am bwfcwalshy (https://keybase.io/bwfcwalshy) on keybase.
  • I have a public key ASBTVVRTtfEa92ci4uKxVBAfX7poInccgStQuAAVyNiE4wo

To claim this, I am signing this object: