Skip to content

Instantly share code, notes, and snippets.

View camarin24's full-sized avatar

Cristian Marín camarin24

  • Iluma
  • Medellín, Colombia
  • 10:20 (UTC -05:00)
View GitHub Profile
@camarin24
camarin24 / py.py
Created November 28, 2018 16:10
Python Learning Anotations
"""
HOW TO: https://docs.python.org/3/howto/index.html
[:] Todos los elementos.
[start:] Todos los elementos desde el índice establecido(start).
[:end] Todos los elementos desde el índice cero hasta el índice establecido(end).
[start:end] Todos los elementos de un rango de índices.
[start:end:step] Todos los elementos de un rango de índices con saltos.
NOTE: Funciona de la misma forma en tuplas
"""
@camarin24
camarin24 / OrdenPorSeleccion.js
Created May 28, 2018 19:26
Ordenamiento por selección
const OrdenPorSeleccion = m => {
for (let i = 0; i < m.length - 1; i++) {
let min = i;
for (let j = i + 1; j < m.length; j++) {
if (m[j] < m[min]) {
min = j;
}
}
const aux = m[i];
m[i] = m[min];
const matriz = [
[
{ value: 0, used: false, position: 1 },
{ value: 1, used: false, position: 2 },
{ value: 0, used: false, position: 3 },
{ value: 1, used: false, position: 4 },
{ value: 1, used: false, position: 5 }
],
[
{ value: 0, used: false, position: 1 },
[Desktop Entry]
Version=1.0
Name=Pycharm
Comment=IDE for python
Exec=/usr/pycharm/pycharm-community-2017.3.3/bin/pycharm.sh
Path=/usr/pycharm/pycharm-community-2017.3.3/bin/
Icon=/usr/pycharm/pycharm-community-2017.3.3/bin/pycharm.png
Terminal=false
Type=Application
Categories=Utility;Development;
@camarin24
camarin24 / groupby.js
Created February 15, 2018 13:20
Group By in Js
groupBy( array , f )
{
var groups = {};
array.forEach( function( o )
{
var group = JSON.stringify( f(o) );
groups[group] = groups[group] || [];
groups[group].push( o );
});
return Object.keys(groups).map( function( group )
@camarin24
camarin24 / WebClient.cs
Created February 9, 2018 15:39
C# Web Client
public class WebClient
{
public string AccessToken { get; set; }
public string BaseUrl { get; set; }
/// <summary>
/// Cliente para hacer peticiones REST Json
/// </summary>
/// <param name="baseUrl">Url base para realizar las peticiones. No debe tener / al final, este se pone automaticamente.</param>
public WebClient(string baseUrl, string accessToken)
@camarin24
camarin24 / regex.txt
Created January 12, 2018 16:57
Regular Expressions
Email : /^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i
@camarin24
camarin24 / GitLabDocker.txt
Created October 11, 2017 00:17
GitLab Docker command line
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
@camarin24
camarin24 / deleteduplicates.sql
Created June 30, 2017 21:36
Delete duplicates rows in a table
DELETE dupes
FROM MyTable dupes, MyTable fullTable
WHERE dupes.dupField = fullTable.dupField
AND dupes.secondDupField = fullTable.secondDupField
AND dupes.uniqueField > fullTable.uniqueField
@camarin24
camarin24 / soap.xml
Created June 30, 2017 17:43
Soap configuration section
<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=""/>