This file contains hidden or 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 functools import update_wrapper | |
| from django.contrib import admin | |
| from django.contrib.admin import ModelAdmin | |
| from django.contrib.admin.templatetags.admin_urls import add_preserved_filters | |
| from django.core.exceptions import PermissionDenied | |
| from django.shortcuts import render | |
| from myapp.models import Widget | |
| from myapp.forms import ManageWidgetForm |
This file contains hidden or 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
| # defmodule Repo.Migrations.LogsHTTP do | |
| # use Ecto.Migration | |
| # def up do | |
| # execute """ | |
| # CREATE TABLE logs_http( | |
| # id serial primary key, | |
| # request_id varchar(200), | |
| # method varchar(8), | |
| # path varchar(128), |
This file contains hidden or 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
| +(NSString *)returnURL: (requestMethodGET)methodGET line:(id)line{ | |
| NSString *SPTrans = @"http://api.olhovivo.sptrans.com.br/v0"; | |
| switch (methodGET) { | |
| case requestMethodGETLinhas: return [NSString stringWithFormat:@"%@/Linha/Buscar?termosBusca=%@", SPTrans, line]; break; | |
| case requestMethodGETDetalhes: return [NSString stringWithFormat:@"%@/Linha/CarregarDetalhes?codigoLinha=%@", SPTrans, line] ;break; | |
| case requestMethodGETParadas: return [NSString stringWithFormat:@"%@/Parada/Buscar?termosBusca=%@", SPTrans, line] ;break; | |
| case requestMethodGETParadasPorLinha: return [NSString stringWithFormat:@"%@/Parada/BuscarParadasPorLinha?codigoLinha=%@", SPTrans, line] ;break; | |
| case requestMethodGETParadasPorCorredor: return [NSString stringWithFormat:@"%@/Parada/BuscarParadasPorCorredor?codigoCorredor=%@", SPTrans, line] ;break; | |
| case requestMethodGETCorredores: return [NSString stringWithFormat:@"%@/Corred |
This file contains hidden or 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
| defmodule Image.Transformer do | |
| def transform(original_file, operation \\ "convert") do | |
| thumb_path = generate_thumb_file(original_file) | |
| System.cmd(operation, operation_commands(original_file_path, thumb_path)) | |
| thumb_path | |
| end | |
| defp generate_thumb_file(original_file) do |
This file contains hidden or 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
| defmodule MyApp.Repo.Migrations.AddPostgresTriggerAndFunctionForAllTables do | |
| use Ecto.Migration | |
| def up do | |
| # Create a function that broadcasts row changes | |
| execute " | |
| CREATE OR REPLACE FUNCTION broadcast_changes() | |
| RETURNS trigger AS $$ | |
| DECLARE | |
| current_row RECORD; |
OlderNewer