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 namespaced_config_options(app, prefix): | |
"""Returns a dictionary of configuration options built from | |
the specified Flask application and string prefix. Keys in the | |
resulting dictionary will be lowercase. | |
:param app: a Flask application | |
:param prefix: a configuration namespace prefix. e.g. `IMAGE_STORE` | |
""" | |
rv = {} | |
for key, value in app.config.iteritems(): |
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
angular.module('something') | |
.directive 'windowResize', ($window, $parse) -> | |
restrict: 'A' | |
link: (scope, element, attrs) -> | |
w = angular.element($window) | |
fn = $parse(attrs['windowResize']) | |
handler = (event) -> |
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 logging | |
from flask_mail import Message | |
class FlaskMailLogHandler(logging.Handler): | |
def __init__(self, mail, sender, recipients, subject, *args, **kwargs): | |
super(FlaskMailLogHandler, self).__init__(*args, **kwargs) |
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
{ | |
"provisioners": [ | |
{ | |
"type": "shell", | |
"scripts": [ | |
"scripts/base.sh", | |
"scripts/vagrant.sh", | |
"scripts/virtualbox.sh", | |
"scripts/ruby.sh", | |
"scripts/chef.sh", |
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
<snippet> | |
<tabTrigger>module</tabTrigger> | |
<scope>source.python</scope> | |
<description>Module</description> | |
<content><![CDATA[# -*- coding: utf-8 -*- | |
""" | |
${1:name} | |
${1/./~/g} |
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
# -*- coding: utf-8 -*- | |
""" | |
helpers | |
~~~~~~~ | |
helpers module | |
""" | |
import pkgutil | |
import importlib |
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
Vagrant::Config.run do |vagrant| | |
vagrant.vm.define :vm1 do |config| | |
config.vm.box = "precise64" | |
config.vm.box_url = "http://files.vagrantup.com/precise64.box" | |
config.vm.network :hostonly, "192.168.0.80" | |
config.vm.host_name = 'rabbit1' | |
config.vm.provision :chef_solo do |chef| | |
chef.add_recipe "apt" | |
chef.add_recipe "hostsfile" |
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
#target photoshop | |
main (); | |
function cloneRectangle(rect) { | |
return { x:rect.x, y:rect.y, width:rect.width, height:rect.height }; | |
} | |
function rectangle(x, y, width, height) { | |
return { x:x, y:y, width:width, height:height }; |
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
--- | |
- hosts: testing | |
user: ubuntu | |
sudo: True | |
vars_files: | |
- software/nginx/vars/default.yml | |
tasks: |
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
# Supervisord auto-start | |
# | |
# description: Auto-starts supervisord | |
# processname: supervisord | |
# pidfile: /var/run/supervisord.pid | |
PATH=/sbin:/usr/sbin:/bin:/usr/bin | |
NAME=supervisord | |
DESC="supervisod is a system for controlling process state" | |
SUPERVISORD=/usr/local/bin/supervisord |