$this->redirect($this->request->route()->uri(array(
'controller' => 'welcome',
'action' => 'home',
)));
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
{% load static %} | |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" | |
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> |
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
var webpack = require('webpack'); | |
var path = require('path'); | |
var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
var src = path.join(__dirname, 'src'); | |
var config = { | |
devServer: { | |
hot: true, |
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
class Finances | |
@@sum = 0 | |
def self.get_orders | |
Order.where(state: [1, 2, 3, 4]) | |
end | |
def self.get_bids | |
BidRequest.where(state: [1, 2, 3, 5]) |
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
/** | |
* queryString handler | |
* by Sergio Melendez | |
* | |
* Usage: | |
* url = location.pathname + getQuery().set('foo', 'bar').remove('baz'); | |
*/ | |
function getQuery() { | |
var data = {}; |
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
<?php | |
/** | |
* Author: Sergio Melendez | |
* www.inspiredsolutions.pe | |
* | |
* Usage: | |
* $data = TreeArray::factory($array, $indicators)->get(); | |
* | |
* Input: [['a': 1, 'b': 2],['a': 1, 'b': 3]] | |
* Input: ['a'] |
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
import datetime | |
def prettydate(d): | |
diff = datetime.datetime.utcnow() - d | |
s = diff.seconds | |
if diff.days > 7 or diff.days < 0: | |
return d.strftime('%d %b %y') | |
elif diff.days == 1: | |
return '1 day ago' | |
elif diff.days > 1: | |
return '{} days ago'.format(diff.days) |
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
<?php | |
$server = $_SERVER['SERVER_NAME']; | |
$host = 'http://200.48.11.178'; | |
$clientCarroceria = new SoapClient($host."/webservices/carroceria.php?wsdl"); | |
var_dump($clientCarroceria); | |
//die(); |
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
<?php | |
/** | |
* ODBC for DBO | |
* Modified by Sergio Melendez | |
* | |
* It works for a Linux / Apache / PHP / PDO_ODBC / ODBC / MSSQL environment | |
* The PDO driver provided by Microsoft for Linux, doesn't implement some PDO methods, | |
* you have to modify Model.php and DboSource.php as well (You can ask me for details) | |
* | |
* PHP versions 4 and 5 |
NewerOlder