Skip to content

Instantly share code, notes, and snippets.

View andresdouglas's full-sized avatar

Andres Douglas andresdouglas

View GitHub Profile
@codef0rmer
codef0rmer / angular-jqueryui-dnd.html
Last active February 22, 2018 10:23
AngularJS + jQueryUI Drag & Drop
<!DOCTYPE html>
<html ng-app="App">
<head>
<meta name="description" content="AngularJS + jQuery UI Drag-n-Drop" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.0.1/angular.min.js"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap.min.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<meta charset=utf-8 />
{% macro postconf(key, value) -%}
postconf-{{ key }}:
cmd:
- run
- name:
- postconf -e {{ key }}='{{ value }}'
- unless: test "x$(postconf -h {{ key }} )" = 'x{{ value }}'
- require:
- pkg: postfix
include:
- apt
# our custom sources
/etc/apt/sources.list.d/fatbox.list:
file:
- managed
- source: salt://fatbox/debian/apt/fatbox.list
- owner: root
- group: root
@fatbox
fatbox / djangomodule.py
Created January 28, 2012 14:22
Load Django modules from within a Salt module
"""
This allows you to import Django modules into a Salt module
"""
import logging
import sys
import os
log = logging.getLogger(__name__)
@harlanbarnes
harlanbarnes / Vagrantfile
Created January 17, 2012 23:34
Vagrantfile Multi VM
user = ENV['OPSCODE_USER'] || ENV['USER']
base_box = ENV['VAGRANT_BOX'] || 'centos-5.5-x86_64'
Vagrant::Config.run do |config|
config.vm.define :web do |web_config|
web_config.vm.box = base_box
web_config.vm.forward_port("http", 80, 8080)
web_config.vm.provision :chef_client do |chef|
@mattray
mattray / *shell*
Created December 23, 2011 16:59
shell commands for chef-server cookbook
knife cookbook upload apt
knife cookbook upload yum
knife cookbook upload build-essential
knife cookbook upload ucspi-tcp
knife cookbook upload erlang
knife cookbook upload runit
knife cookbook upload bluepill
knife cookbook upload daemontools
knife cookbook upload couchdb
knife cookbook upload apache2
@pydanny
pydanny / field.html
Created November 8, 2011 16:33
django-uni-form + Twitter Bootstrap
<!-- this usually goes in <project-root>/templates/uni_form/field.html -->
{% if field.is_hidden %}
{{ field }}
{% else %}
<div class="clearfix {% if field.errors %}error{% endif %}">
<label for="{{ field.auto_id }}" {% if field.field.required %}class="requiredField"{% endif %}>
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
</label>
<div class="input">
@demonbane
demonbane / makeapp.sh
Created July 5, 2011 20:05
Create a Fluid-style app launcher for single-window Chrome instances on OSX
#!/bin/sh
echo "What should the Application be called (no spaces allowed e.g. GCal)?"
read inputline
name="$inputline"
echo "What is the url (e.g. https://www.google.com/calendar/render)?"
read inputline
url="$inputline"
@mlbright
mlbright / distkeys.py
Created February 23, 2011 16:25
deploy/distribute ssh public key to multiple hosts using Fabric
"""
usage:
fab -f distkeys.py set_hosts:/path/to/hosts_file add_key:/path/to/key
Use --password and --user options as necessary
Inspired by shell script at http://github.com/mlbright/mybin/raw/master/distkeys.sh
Fabric recipe to distribute your ssh key to large number of hosts.
@zyegfryed
zyegfryed / gist:814432
Created February 7, 2011 14:25
Tastypie OAuth
from oauth2 import Error
from django.utils.translation import ugettext as _
from tastypie.authentication import Authentication
from oauth_provider.utils import initialize_server_request, send_oauth_error, get_oauth_request
from oauth_provider.consts import OAUTH_PARAMETERS_NAMES
from oauth_provider.store import store, InvalidTokenError