Skip to content

Instantly share code, notes, and snippets.

View jatovar's full-sized avatar
😁
<3

Jorge Tovar jatovar

😁
<3
View GitHub Profile
@jatovar
jatovar / TipoRelacion.cs
Created November 13, 2018 16:08
Mapeado tipo relacion
private static c_TipoRelacion MapeaTipoRelacion(string tipoRelacion)
{
switch (tipoRelacion)
{
case "01":
return c_TipoRelacion.Item01;
case "02":
return c_TipoRelacion.Item02;
case "03":
return c_TipoRelacion.Item03;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using TestWCFProveedor.TimbradoService;
namespace TestWCFProveedor
{
@jatovar
jatovar / localization.ts
Created March 21, 2018 18:12
Add globalize localization to devextreme
/// <reference path="./typings.d.ts" />
// DevExtreme Globalize integration
import 'devextreme/localization/globalize/number'
import 'devextreme/localization/globalize/date'
import 'devextreme/localization/globalize/currency'
import 'devextreme/localization/globalize/message'
// DevExtreme messages (en messages already included)
import * as deMessages from 'devextreme/localization/messages/es.json'
@jatovar
jatovar / typings.d.ts
Created March 21, 2018 18:09
Typings for cldr-data and devextreme
// This file contains ambient module declarations
declare module 'globalize' {
const value: any;
export = value;
}
declare module 'cldr-data/*' {
const value: any;
export = value;
}
@jatovar
jatovar / webpack.config.js
Created March 21, 2018 18:01
Webpack for parsing CLDR file with globalize :)
const path = require('path');
const webpack = require('webpack');
const merge = require('webpack-merge');
const AotPlugin = require('@ngtools/webpack').AotPlugin;
const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin;
module.exports = (env) => {
// Configuration in common to both client-side and server-side bundles
const isDevBuild = !(env && env.prod);
const sharedConfig = {
@jatovar
jatovar / PUSH_NOTIFICATION.sql
Last active February 19, 2018 19:24
PUSH_NOTIFICATION.sql
create or replace PACKAGE BODY PR_NOTIFICACIONES_PUSH AS
procedure PUSH_NOTIFICATION
(
sDeviceId varchar2,
sDevicePlatform varchar2,
sName varchar2,
sTitle varchar2,
sBody varchar2
@jatovar
jatovar / libroazul.cs
Last active October 9, 2017 14:52
Bug
public async Task<string> GetKey()
{
if (!IsConnected())
throw new NotConnectedException();
try
{
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(MediaType));
@jatovar
jatovar / dummy-web-server.py
Created June 16, 2017 17:50 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand">
<StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand">
<Button Text="Log In"/>
</StackLayout>
<StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand">
<Button Text="Sign Up"/>
</StackLayout>
</StackLayout>
@jatovar
jatovar / startup.auth.cs
Created April 19, 2017 18:29
Oauth2 and OpenID with ASP identity manager
public void ConfigureAuth(IAppBuilder app)
{
//AntiForgeryConfig.UniqueClaimTypeIdentifier = Constants.ClaimTypes.Subject;
JwtSecurityTokenHandler.InboundClaimTypeMap = new Dictionary<string, string>();
// Configure the db context and user manager to use a single instance per request
app.CreatePerOwinContext(ApplicationDbContext.Create);
app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create);
AntiForgeryConfig.UniqueClaimTypeIdentifier = "Subject";