Skip to content

Instantly share code, notes, and snippets.

View matthewryanscott's full-sized avatar

Matthew R. Scott matthewryanscott

View GitHub Profile
@matthewryanscott
matthewryanscott / uninitialized.enaml
Created June 30, 2012 03:08
Component uninitialized; attr changes do not propagate as expected
# System:
# OSX 10.7.4
# Qt 4.8.0
# PySide 1.1.1
from enaml.stdlib.radio_group import RadioGroup
DEFAULT_TRIGGER_METHOD_NAME = 'request_refresh_task'
@matthewryanscott
matthewryanscott / gist:3947224
Created October 24, 2012 16:40
Use of functools.partial instead of using a closure
from functools import partial
def tracecalls(cls):
def my__getattribute__(self, name):
attr = super(cls, self).__getattribute__(name)
return attr if not callable(attr) else partial(whencalled, attr)
cls.__getattribute__ = my__getattribute__
@matthewryanscott
matthewryanscott / creating_functions.py
Created March 5, 2013 23:17
Programmatically creating functions
# This could be called a "function factory".
# It is a function that creates, then returns, new functions.
def generic_site_fn(url_template):
# Define an inner function ...
def generic_site_submit(url):
generic_site_url = url_template.format(url=url)
requests.get(generic_site_url)
# ... that is returned by the factory function.
return generic_site_submit
ufw:
pkg.installed
enable ufw:
cmd.run:
- name: ufw enable
- require:
- pkg: ufw
enable ssh:
{% if 'servmon' in grains['roles'] %}
f2bpath: /var/log/httpd/error_log
{% elif 'webserver' in grains['roles'] %}
f2bpath: /home/*/log/error_log
{% endif %}
class Plantuml < SimpleDelegator
end
module IRuby
module Display
module Registry
type { Plantuml }
format 'image/svg+xml' do |obj|
Tempfile.open('uml') do |uml|
uml.write(obj)

warmcommunity.space Code of Conduct

Please read this before joining our Slack chat:

Be a nice person

Music and sound design attract a wide audience. Let's all be friendly and warm. :-)

Post useful info to forums

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@matthewryanscott
matthewryanscott / sampler.ipynb
Created September 27, 2016 01:13
sampler creation with radiant voices
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.