Skip to content

Instantly share code, notes, and snippets.

@RichoDemus
RichoDemus / rust.rs
Created November 9, 2020 15:45
Writing some legion code to potentially submit an example
use std::thread::sleep;
use std::time::Duration;
use legion::*;
#[derive(Clone, Copy, Debug, PartialEq)]
struct Countdown {
value: i32,
}
@RichoDemus
RichoDemus / readme.md
Created March 21, 2018 13:19
Details on how to extract java from the dmg-file so you don't have to run the oracle installer on MacOS

Unpacking JDK on MacOS

Steps

  1. Download the installer .dmg files. They contain the good stuff.
  2. Mount the .dmg and copy the .pkg file to somewhere
  3. Open a terminal and cd to the folder you copied the .pkg file into pkgutil --expand JDK\ 7\ Update\ 60.pkg JDK7u60 - extract pkg file to folder
  4. cd JDK7u60/ - move to the extracted pkg
  5. cd jdk17060.pkg/ - there's a folder with the version number ending with .pkg (but it's just a folder), go there
  6. Unpack Payload using Archive Utility (use "Open with" in finder), it's located at /System/Library/CoreServices/Applications
@RichoDemus
RichoDemus / kafka.sh
Created February 26, 2018 12:28
Handy Kafka things
# get size of topics
./kafka-log-dirs.sh --describe --bootstrap-server ""
# power options http://apple.stackexchange.com/a/127650
# hibernate after one hour of sleep on battery power
sudo pmset -a standbydelay 3600
sudo pmset -a hibernatemode 25
@RichoDemus
RichoDemus / gist:e5758f2ced5f0037ace6f7084054644e
Last active March 21, 2017 08:30
Playing around with AWS
# SSH
ssh ec2-user@<dns name>
#update and install docker
sudo yum update -y && sudo yum install -y docker && sudo service docker start && sudo usermod -a -G docker ec2-user
@RichoDemus
RichoDemus / Main.kt
Created October 24, 2016 10:54
Kotlin initialize member variables in constructor
class UsingPrimaryConstructorAndInit(val constructor_parameter: String) {
private val initialized_by_class: String
init {
this.initialized_by_class = "asdasd"
}
}
class UsingSecondaryConstructor {
private val constructor_parameter: String
@RichoDemus
RichoDemus / gist:ebe6810e1a765e41b0d45f3585a14fb3
Last active February 26, 2018 12:06
Handy Docker things
docker save <image name> | ssh user@host 'docker load'
docker images | egrep "^<none>" | nawk '{ print $3 } ' | xargs docker rmi
docker system prune
# more: https://www.heavymetalcoder.com/shrink-your-virtual-hard-drive-file-in-docker-for-macos/
docker volume rm $(docker volume ls -qf dangling=true)
## OSX remove VM Disk since it doesn't auto-shrink
```
@RichoDemus
RichoDemus / myBucket.json
Created October 4, 2016 15:56
output from couchbase, for troubleshooting
{
"name": "myBucket",
"bucketType": "membase",
"authType": "sasl",
"saslPassword": "myBucketPassword",
"proxyPort": 0,
"replicaIndex": true,
"uri": "/pools/default/buckets/ges?bucket_uuid=ddbd543c584881b46e92e02cc36ee727",
"streamingUri": "/pools/default/bucketsStreaming/ges?bucket_uuid=ddbd543c584881b46e92e02cc36ee727",
"localRandomKeyUri": "/pools/default/buckets/ges/localRandomKey",
@RichoDemus
RichoDemus / simc_gui.simc
Created October 1, 2016 23:26
Simulationcraft simc
### Begin GUI options ###
item_db_source=local/bcpapi/wowhead
target_error=0
iterations=100
default_world_lag=0.1
max_time=300
vary_combat_length=0.2
fight_style=Patchwerk
tmi_window_global=6
target_level+=3
@RichoDemus
RichoDemus / gist:fa8290b924195bd33e60
Created February 24, 2016 07:31
Remove Manjaro bloat
25 pacman -Rsn flashplugin
26 sudo pacman -Rsn flashplugin
29 sudo pacman -Rsn gimp
33 sudo pacman -Rsn libreoffice-still
36 sudo pacman -Rsn viewnior
40 sudo pacman -Rsn pidgin
43 sudo pacman -Rsn firefox-gtk2
48 sudo pacman -Rsn hexchat
51 sudo pacman -Rsn thunderbird
57 sudo pacman -Rsn guayadeque