First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel
Then ssh with root account, run this in termianl:
$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash| #!/bin/sh | |
| # Install ImageMagick on Snow Leopard: by kain, improved by mislav and samsoffes | |
| # http://www.icoretech.org/2009/08/install-imagemagick-in-leopard-snow-leopard/ | |
| # Work with 64bit kernel mode | |
| set -e | |
| PREFIX=/usr/local | |
| # Passenger users: amend your Apache global configuration with the following directive | |
| # SetEnv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin |
| """ | |
| The HOSTMAP variable is a dictionary of lists. The keys represent | |
| roles of a server, the values represent the hostnames of machines that | |
| fill those roles. If you are reading this, you likely know what you're | |
| doing. If you don't know what you're doing, you probably want to put | |
| your hostname into local_dev. Ensure it has a comma at the end, and | |
| the hostname is a string. | |
| You can get your hostname by typing `hostname` into a terminal. |
| /* | |
| * Sweet sugar for jQuery's $.data API. | |
| * http://yehudakatz.com/2009/04/20/evented-programming-with-jquery/ | |
| * | |
| * Instead of this: | |
| * | |
| * $("#foo").data("foo"); // Get foo | |
| * $("#foo").data("foo", 'bar'); // Set foo | |
| * | |
| * Do this: |
| #!/usr/bin/env bash | |
| # ---------------------------------------------------- | |
| # | |
| # Automated setup for a Ubuntu server with git, ruby, rvm, nginx. | |
| # (Used at Carbonmade) | |
| # | |
| # Usage: | |
| # - SCP this file to your server: scp ubuntu_setup.sh you@server:~ | |
| # - Make it executable: chmod +x ubuntu_setup.sh | |
| # - Run it: bash ubuntu_setup.sh |
| class MyThing(object): | |
| def save(self, *args, **kwargs): | |
| # If only I could `my_kwarg = kwargs.delete('my_kwarg') | |
| my_kwarg = kwargs.pop('my_kwarg', False) | |
| print "did some things" | |
| # result = super(SpecialThing, self).save(*args, **kwargs) | |
| if my_kwarg: | |
| print "did other things, because of the kwarg" | |
| # self.do_more_stuff() |
| from django.shortcuts import render | |
| def some_view(request, template_name='path/to/template.html', extra_context={}): | |
| context = extra_context.copy() | |
| # Request remote page and parse it | |
| foo = 'Some template variable' | |
| context['foo'] = foo | |
| return render(request, template_name, context) |
| import random | |
| import string | |
| import base64 | |
| import zlib | |
| import bz2 | |
| random_ids = [''.join([random.choice(string.ascii_lowercase) for x in range(8)]) for n in range(1000)] | |
| long_string = ','.join(random_ids) |
| // Start fading in slowly... | |
| jQuery('.alert').fadeIn("fast", function() { | |
| // This callback gets run once the fadeIn has finished. | |
| jQuery('.alert').fadeOut("slow"); | |
| }); |
This is how you connect PS3 controller to Mac OSX, PC, etc. when previously connected to a PS3. You will need a Mini USB cable. Overcome your laziness and go get one!
A big misconception is that keep holding PS button will reset the controller's pairing. It doesn't! From my testing, the controller pairs with the last machine it was CONNECTED VIA A USB CABLE.
Here are the real Steps: