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
""" | |
IAM boto examples: | |
In this example we create a group that provides access | |
to all EC2 and S3 resources and actions and then add a | |
user to that group. | |
""" | |
import boto | |
# | |
# First create a connection to the IAM service |
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
package com.amazon.aws.demo; | |
import java.io.BufferedInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.PrintWriter; | |
import java.io.StringWriter; | |
import java.io.Writer; | |
import java.net.URL; | |
import java.net.URLConnection; |
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 django.db import models | |
class Person(models.Model): | |
name = models.CharField(max_length=200) | |
groups = models.ManyToManyField('Group', through='GroupMember', related_name='people') | |
class Meta: | |
ordering = ['name'] | |
def __unicode__(self): |
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
{# use in combination with https://github.com/zyga/django-pagination #} | |
{# and http://twitter.github.com/bootstrap/ #} | |
{# project-dir/templates/pagination/pagination.html #} | |
{% if is_paginated %} | |
{% load i18n %} | |
<div class="pagination"> | |
<ul> | |
{% block previouslink %} | |
{% if page_obj.has_previous %} |
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
< | |
%3C | |
< | |
< | |
< | |
< | |
< | |
< | |
< | |
< |
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
LINK_DETECTION_REGEX = /(([a-z]+:\/\/)?(([a-z0-9\-]+\.)+([a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel|local|internal))(:[0-9]{1,5})?(\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(\?[a-z0-9+_\-\.%=&]*)?)?(#[a-zA-Z0-9!$&'()*+.=-_~:@/?]*)?)(\s+|$)/gi | |
EMOJI_DIRECTORY = "/path/to/assets/emoji/20x20" | |
# Handlebars is presumed, but you could swap out | |
ESCAPE_EXPRESSION_FUNCTION = Handlebars.Utils.escapeExpression | |
MARKSAFE_FUNCTION = (str) -> new Handlebars.SafeString(str) | |
# Emoji unicode chars become images. |
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
var isPortTaken = function(port, fn) { | |
var net = require('net') | |
var tester = net.createServer() | |
.once('error', function (err) { | |
if (err.code != 'EADDRINUSE') return fn(err) | |
fn(null, true) | |
}) | |
.once('listening', function() { | |
tester.once('close', function() { fn(null, false) }) | |
.close() |
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
Postgres manual located here: http://www.postgresql.org/docs/8.4/interactive/index.html | |
These instructions should work for Postgres 8 and 9 | |
1. INSTALL | |
$ cd ~/source | |
$ ftp http://ftp.postgresql.org/pub/source/v8.4.11/postgresql-8.4.11.tar.gz | |
$ tar -zxvf postgresql-8.4.11.tar.gz | |
$ rm -r postgresql-8.4.11.tar.gz | |
$ cd postgresql-8.4.11 | |
$ ./configure |
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
#!/usr/bin/env python | |
# PEP 20 supersedes PEP 8 http://www.python.org/dev/peps/pep-0008/#a-foolish-consistency-is-the-hobgoblin-of-little-minds | |
# Follow PEP 20 if readability is affected by PEP 8 | |
# max length 79 chars, not 80 (http://www.python.org/dev/peps/pep-0008/#maximum-line-length) | |
"""One-line summary of purpose. # double quoted docstrings; max length 72 chars (http://www.python.org/dev/peps/pep-0008/#maximum-line-length) | |
# 2nd line must be blank http://www.python.org/dev/peps/pep-0257/#multi-line-docstrings | |
More things # aligns with the quotes | |
More things | |
""" |
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
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
OlderNewer