This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id: eir | |
tasks: | |
- id: eir::lorebook_install | |
deps: ['assets::install'] | |
task: | | |
export finder_root_param="$assets_out" | |
linker \ | |
"$(finder death_record.ttf)" \ | |
"links/fonts/death_record.ttf" \ | |
"$(finder chalkboard.jpg)" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Edit this configuration file to define what should be installed on | |
# your system. Help is available in the configuration.nix(5) man page | |
# and in the NixOS manual (accessible by running ‘nixos-help’). | |
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2018-11-28T09:47:00.421Z","extensionVersion":"v3.2.2"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@spec new_grid(pos_int, pos_int) :: grid | |
def new_grid(height, width), do: new_grid(height, width, []) | |
@spec new_grid(pos_int, pos_int, [cell_state]) :: grid | |
defp new_grid(h, w, acc) | |
defp new_grid(0, _w, acc), do: acc | |
defp new_grid(h, w, acc), do: new_grid(h - 1, w, [new_grid_line(w) | acc]) | |
@spec new_grid_line(pos_int, [cell_state]) :: [cell_state] | |
defp new_grid_line(width, acc \\ []) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from destructuring import destructure | |
from unittest import TestCase, main | |
from types import FunctionType | |
""" | |
This is just a proposition on how destructuring could be done in Python. | |
This is just an exercise, the result itself is not meant to be pragmatic for everyday Python code. | |
Unpacking is a limited form of destructuring: | |
a, b, c = [1, 2, 3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;tl:dr | |
(defn start-scroll-interval [] | |
; Uses (re-frame/dispatch [:set-auto-scroll-id interval-id]) | |
..) | |
(defn stop-scroll-interval [] | |
; Uses (re-frame/dispatch [:set-auto-scroll-id nil]) | |
..) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from inspect import signature | |
from uuid import uuid1 | |
# Just a proof of concept implementation of destructuring in python | |
def destructurable_params(fn, args): | |
"""Return a list of dicts that contain destructuring expressions and the parameters values. | |
Parameters with no valid destructuring syntax will be ignored. | |
:param fn: Function of interest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_tests(test_case_class): | |
"""Gets all tests from a TestCase class. | |
:param test_case_class: A subclass of TestCase | |
:return: tests in the TestCase | |
""" | |
test_case_instance = eval(test_case_class.__name__ + "()") | |
func_type = type(lambda x: None) | |
test_methods = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import urllib2 | |
def check_in(): | |
fqn = os.uname()[1] | |
ext_ip = urllib2.urlopen('http://whatismyip.org').read() | |
print ("Asset: %s " % fqn, "Checking in from IP#: %s " % ext_ip) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import smtplib | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
import socket | |
from time import sleep | |
conf = dict( | |
# Any email address | |
toEmail='your_email@gmail.com', | |
# Google e-mail address |
NewerOlder