Skip to content

Instantly share code, notes, and snippets.

upstream jira {
server 127.0.0.1:8080;
}
upstream stash {
server 127.0.0.1:7990;
}
server {
listen 0.0.0.0:80;
@defaultModalZindex: 9999;
.border-radius(@radius) {
-webkit-border-radius: @radius;
border-radius: @radius;
}
.box-shadow(@shadow) {
-webkit-box-shadow: @shadow;
box-shadow: @shadow;
current_dir = File.dirname(__FILE__)
chef_repo_dir = "#{current_dir}/../../chef-repo"
home_dir = ENV['HOME']
user = ENV['KNIFE_USER'] || ENV['USER']
orgname = ENV['KNIFE_ORGNAME']
server_name = ENV['KNIFE_SERVER_NAME']
server_url = ENV['KNIFE_SERVER_URL']
cookbook_path ["#{chef_repo_dir}/cookbooks"]
#!/usr/bin/env python
import sys
import time
import requests
import gntp.notifier
GENERAL_NOTIFICATION = 'General'
API_ERROR_NOTIFICATION = 'API Error'
FRIEND_ONLINE_NOTIFICATION = 'Friend Online'
@defaultModalZindex: 9999;
.border-radius(@radius) {
-webkit-border-radius: @radius;
border-radius: @radius;
}
.box-shadow(@shadow) {
-webkit-box-shadow: @shadow;
box-shadow: @shadow;
* {
margin: 0px;
padding: 0px;
}
html {
overflow: hidden;
}
img#embed {
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^api/', include('helium.api.urls')),
url(r'^apps/', include('helium.apps.urls')),
url(r'^accounts/', include('helium.accounts.urls')),
import requests, json, re
def camelcase_to_underscore(text, lower=True):
text = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', text)
text = re.sub('([a-z0-9])([A-Z])', r'\1_\2', text)
if lower:
text = text.lower()
return text
class TrackingPixelMiddleware(object):
def process_message(self, message):
message.body = '%s<img src="http://example.com/track.gif">' % (message.body,)
return message
var authorize = function(username, key) {
jQuery.ajaxSetup({
beforeSend: function(xhr) {
xhr.setRequestHeader('Authorization', 'ApiKey ' + username + ':' + key);
return xhr;
}
});
};
authorize('amccloud', '204db7bcfafb2deb7506b89eb3b9b715b09905c8');