Skip to content

Instantly share code, notes, and snippets.

@wakemaster39
wakemaster39 / scopes.lua
Created February 8, 2014 17:15
global manipulating in scopes
TEST ={t={}}
do
print(TEST.t.stolen)
local test = TEST.t
test.stolen = true
print(TEST.t.stolen)
end
output:
nil
@wakemaster39
wakemaster39 / output.txt
Created July 11, 2018 15:49
vagrant up output
vagrant up --debug
INFO global: Vagrant version: 2.1.2
INFO global: Ruby version: 2.4.4
INFO global: RubyGems version: 2.6.14.1
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/bin/vagrant"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
INFO global: VAGRANT_LOG="debug"
WARN global: resolv replacement has not been enabled!
@wakemaster39
wakemaster39 / gopass-client.py
Last active February 17, 2021 14:21
Ansible Vault Password integration with gopass
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Assuming you have a working gopass installation. I personally use multiple mounts and I store all the passwords under a
# single directory.
#
# Add the following section to your `ansible.cfg`
#
# [vault]
# mount='store-X' # replace `store-x` with your actual store, if using the root set to an empty string
import requests
import os
dir = os.path.dirname(__file__)
f = open(os.path.join(dir, "data.txt"))
inputs = [int(x) for x in f]
# Question 1 answer
print(sum(inputs))
import os
import json
from attr import attrs, attrib
from datetime import datetime
from enum import Enum
import re
dir = os.path.dirname(__file__)
file_name =os.path.join(dir, "data.txt")
f = open(file_name)
import os
import json
import functools
from aocd import get_data
DAY=5
dir = os.path.dirname(__file__)
directory = os.path.join(dir, f"day{DAY}")
if not os.path.exists(directory):
@wakemaster39
wakemaster39 / nitpick.toml
Last active May 18, 2022 14:08
nitpick configuration for python
[".editorconfig"]
root = true
[".editorconfig"."*"]
indent_style = "space"
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = "lf"
charset = "utf-8"