Skip to content

Instantly share code, notes, and snippets.

View ejulio's full-sized avatar
🏠
Working from home

Júlio César Batista ejulio

🏠
Working from home
View GitHub Profile
@ejulio
ejulio / index.html
Last active March 9, 2019 13:06
Code for my blog post about binary requests using ExtJS
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Image</title>
<link href="http://cdn.sencha.com/ext/gpl/4.2.0/resources/css/ext-all.css" rel="stylesheet" />
<script src="http://cdn.sencha.com/ext/gpl/4.2.0/ext-all.js"></script>
</head>
<body>
@ejulio
ejulio / AsyncComparison.cs
Created July 17, 2013 23:31
Código para o post no blog sobre operadores em C#
class Program
{
static void Main(string[] args)
{
Matrix m1 = new Matrix();
Matrix m2 = new Matrix();
Task<bool> result = m1 == m2;
Console.WriteLine("Alguma operação para ser executada enquanto a comparação acontece");
// equals
class A : IComparable<A>
{
public int Value { get; set; }
public override bool Equals(object obj)
{
A other = obj as A;
return Value == other.Value;
}
@ejulio
ejulio / Ext_ux_webstorage.js
Created July 13, 2013 00:52
Examples of the usage of Ext.ux.webstorage
// dados compactados
var localStorage = Ext.create('Ext.ux.webstorage.Storage', {
storage: window.localStorage,
textCompactor: true // pode ser um objeto com dois métodos (compress e decompress)
});
// dados não compactados e keys com namespaces
var sessionStorage = Ext.create('Ext.ux.webstorage.Storage', {
storage: window.sessionStorage,
namespace: 'app'
@ejulio
ejulio / ImagePreview.js
Created July 5, 2013 23:16
Image preview blog post
window.addEventListener('DOMContentLoaded', function()
{
DragDrop.init(document.body);
});
var DragDrop = {
element: undefined,
isOver: false,
init: function(element)
{
@ejulio
ejulio / Code_0.js
Last active December 16, 2015 00:19
Código para a implementação de uma cálculadora de pilha com notação polonesa inversa. O código foi desenvolvido demonstrando os passos de TDD com os frameworks QUnit e Jasmine para Javascript
var Calculator = {
setExpression: function () { return this; },
calculate: function () { return 0; }
};
Ext.define('MinhaApi.Error', {
statics: {
raise: function(message)
{
if (Ext.Error) // pode-se fazer uma verificação do tipo: Api.isDesktop
{
Ext.Error.raise(message);
}
else
{
Ext.define('MinhaApi.Observable', {
extend: Ext.novopackage.Observable || Ext.novopackagemobile.Observable
});
Ext.define('MinhaApi.Observable', {
extend: Ext.util.Observable || Ext.mixins.Observable
});
Ext.define('MinhaClasse', {
extend: 'MinhaApi.Observable'
});
Ext.define('ClasseTouch', {
extend: 'Ext.mixins.Observable'
});
Ext.define('ClasseExt', {
extend: 'Ext.util.Observable'
});
// É possível melhorar o código para
Ext.define('MinhaClasse', {