http://udinic.wordpress.com/2013/07/24/write-your-own-android-sync-adapter/ https://github.com/Udinic/SyncAdapter
Criando Contas (Autenticator)
import javafx.scene.layout.StackPane; | |
import javafx.scene.web.WebView; | |
/** | |
* A syntax highlighting code editor for JavaFX created by wrapping a | |
* CodeMirror code editor in a WebView. | |
* | |
* See http://codemirror.net for more information on using the codemirror editor. | |
*/ | |
public class CodeEditor extends StackPane { |
#!/bin/bash | |
# Based on https://gist.github.com/2206527 | |
# Be pretty | |
echo -e " " | |
echo -e " . ____ . ______________________________" | |
echo -e " |/ \| | |" | |
echo -e "[| \e[1;31m♥ ♥\e[00m |] | S3 MySQL Backup Script v.0.1 |" | |
echo -e " |___==___| / © oodavid 2012 |" |
http://udinic.wordpress.com/2013/07/24/write-your-own-android-sync-adapter/ https://github.com/Udinic/SyncAdapter
Criando Contas (Autenticator)
#!/usr/bin/python | |
import sys | |
import MySQLdb | |
import subprocess | |
my_host = "localhost" | |
my_user = "usuario" | |
my_pass = "senha" | |
my_db = "banco" | |
command_restart_mysql = "service mysql restart" |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.mysql', | |
'NAME': 'nome-do-banco', | |
'USER': 'ususario-do-banco', | |
'PASSWORD': 'senha', | |
'HOST': 'localhost', | |
'PORT': '3306', | |
} | |
} |
class ExtraMixin(object): | |
def get_context_data(self): | |
context = super(ExtraMixin, self).get_context_data() | |
context['random'] = RandomModel.objects.all() | |
return context | |
class MyBeatifulView(ExtraMixin, TemplateView): | |
... |
#!/usr/bin/env python | |
# Copyright (C) 2013 by Claudemiro Alves Feitosa Neto | |
# <[email protected]> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# |
from django.contrib import admin | |
from django.contrib.flatpages.models import FlatPage | |
class MyFlatPageAdmin(admin.ModelAdmin): | |
class Media: | |
js = ('1.js', '2.js',) | |
admin.site.unregister(FlatPage) | |
admin.site.register(FlatPage, MyFlatPageAdmin) |
import random | |
notas = ['C', 'D', 'E', 'F', 'G', 'A', 'B'] | |
while True: | |
nota = random.randint(0, len(notas) - 1) | |
if nota == (len(notas) - 1): | |
nota = 0 |
------------------------ EXEMPLO 1 ----------------------- | |
Hello World. | |
World { | |
font-style: bold; | |
color: green; | |
} | |