Skip to content

Instantly share code, notes, and snippets.

@Skinner927
Skinner927 / vuex_cheat_sheet.md
Last active January 27, 2023 11:56
Vuex Cheat Sheet

Vuex Cheat Sheet

new Vuex.Store({
  modules: {
    counter: {
      state: {
        count: 0,
      },
      getters: {
        square(state) {
@Skinner927
Skinner927 / imap_delete_emails.py
Last active April 30, 2019 20:55
Delete all emails from email inboxes via IMAP
#!/usr/bin/env python3
import imaplib
import sys
from itertools import chain
server = 'imap.mail.yahoo.com'
port = 993
username = '[email protected]'
password = 'hunter2'
19 ### Kernel module `br_netfilter`
20 - `sudo vim /etc/modules` and add `br_netfilter` to the end.
21 - `sudo modprope br_netfilter`
22 - `sudo vim /etc/sysctl.conf` and add the following lines:
23 ```
24 net.bridge.bridge-nf-call-arptables = 1
25 net.bridge.bridge-nf-call-ip6tables = 1
26 net.bridge.bridge-nf-call-iptables = 1
27 ```
28
@Skinner927
Skinner927 / mc_death_location.txt
Last active January 25, 2019 23:00
Minecraft Command Block Death Location
All these block should feed into eachother. Meaning the first block should points at the second, and so on.
Repeat | Unconditional | Always active
execute as @a[nbt={Health:0.0f}] store result score @s lastpos_x run data get entity @s Pos[0]
Chain | Conditional | Always active
execute as @a[nbt={Health:0.0f}] store result score @s lastpos_y run data get entity @s Pos[1]
Chain | Conditional | Always active
execute as @a[nbt={Health:0.0f}] store result score @s lastpos_z run data get entity @s Pos[2]
@Skinner927
Skinner927 / _Minecraft_Server_Readme.md
Last active April 8, 2024 04:22
Minecraft Server Setup

Minecraft Server Setup

This is for Ubuntu 18.04 / Systemd

Install deps

sudo apt-get install -y screen wget rdiff-backup openjdk-11-jre-headless

Create a minecraft service user

@Skinner927
Skinner927 / static_property_descriptor.py
Last active December 30, 2018 00:47
Python static property using a non-data descriptor
"""
This is an example of how to create a static property using a
non-data descriptor.
https://docs.python.org/2/howto/descriptor.html
This works in python >= 2.3 including 3.x.
In this example the __get_default() method is called the first time
we need to access Widget.default. The __get_default method clobbers
@Skinner927
Skinner927 / etc|docker|daemon.json
Created December 13, 2018 01:58
Specify docker's IP range for bridged adapters
{
"bip": "192.168.128.5/24",
"default-address-pools": [{"base": "192.168.0.0/17", "size": 24}]
}
@Skinner927
Skinner927 / MyXubuntuSetup.md
Last active May 14, 2019 13:35
How I setup my XUbuntu boxes

How to setup computer

This document describes how I set up my development environment with a fresh install of Xubuntu 16.04 (Xubuntu is Ubuntu with xfce).

Currently this document describes how to set up:

  • Generic desktop environment with all the goodies (themes, keyboard, utilities).
  • Python 2 & 3 development with PyCharm.
@Skinner927
Skinner927 / init.lua
Last active November 15, 2020 22:10
Hammerspoon auto screen position script
hs.urlevent.bind('reload', function(eventName, params)
hs.reload()
end)
hs.urlevent.bind('currentScreenTag', function(eventName, params)
alert(getScreenTag())
end)
hs.urlevent.bind("printLayout", function(eventName, params)
config = {}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.