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
| app.post("/registro", function (req, res) { | |
| var datos = { | |
| nombre: req.body.nombre, | |
| apellido: req.body.apellido, | |
| fecha_nacimiento: req.body.fechaNacimiento, | |
| correo_electronico: req.body.email, | |
| contrasenia: req.body.password | |
| }; | |
| db.query("SELECT * FROM personas WHERE correo_electronico = ?", [req.body.email], function (err, user) { | |
| if (err) throw err; |
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
| interface IRepository<T>{ | |
| Delete(Entity:T):T; | |
| Update(Entity:T):T; | |
| Create(Entity:T):T; | |
| } | |
| class IComprasRepository implements IRepository<ComprasModel>{ | |
| private _url:string; | |
| constructor(url:string){ | |
| this._url = url; | |
| } |
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
| public static class LinqExtension | |
| { | |
| public static int[] ConvertToArrayInt<T>(this List<T> data, Func<T,int> lamba) | |
| { | |
| return data.Select(lamba).ToArray(); | |
| } | |
| } |
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
| public static class LinqExtension | |
| { | |
| public static List<T> Paginate<T>(this List<T> data, Func<T, object> orderBy, int pageSize, int PageNumber) | |
| { | |
| var model = data.OrderBy(orderBy).Skip((PageNumber - 1) * pageSize).Take(pageSize).ToList(); | |
| return model; | |
| } | |
| } |
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
| public interface IRepository<T> where T : class | |
| { | |
| IQueryable<T> All { get; } | |
| T Delete(T entity); | |
| T FindById(object Id); | |
| T Insert(T entity); | |
| T Update(T entity, T oldEntity, out bool modified); | |
| } | |
| public abstract class BaseEFRepository<TEntity> : IRepository<TEntity> where TEntity : class, new() |
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
| private T DeserializeYahooRequest<T>(string response) where T : class, new() | |
| { | |
| T model = new T(); | |
| string[] parameters = response.Split('&'); | |
| foreach (var item in parameters) | |
| { | |
| var elem = item.Split('='); | |
| PropertyInfo propertyInfo = model.GetType().GetProperty(elem[0]); | |
| propertyInfo.SetValue(model, Convert.ChangeType(elem[1], propertyInfo.PropertyType), null); | |
| } |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| namespace Web.Helpers | |
| { | |
| public static class AsyncHelpers | |
| { | |
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
| <system.serviceModel> | |
| <bindings> | |
| <basicHttpBinding> | |
| <binding maxReceivedMessageSize="1024000" name="ZWS_PRECIO_VENTA" closeTimeout="00:10:00" | |
| openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"> | |
| <security mode="TransportCredentialOnly"> | |
| <transport clientCredentialType="Basic" proxyCredentialType="None" realm=""/> |
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
| DELETE dupes | |
| FROM MyTable dupes, MyTable fullTable | |
| WHERE dupes.dupField = fullTable.dupField | |
| AND dupes.secondDupField = fullTable.secondDupField | |
| AND dupes.uniqueField > fullTable.uniqueField |
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
| docker run --detach --name gitlab --hostname 127.0.0.1 --publish 30080:30080 --publish 30022:22 --env GITLAB_OMNIBUS_CONFIG="external_url 'http://127.0.0.1:30080'; gitlab_rails['gitlab_shell_ssh_port']=30022;" gitlab/gitlab-ce |
OlderNewer