This file contains 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 numpy as np | |
import pandas as pd | |
N = 10000 | |
df = pd.DataFrame( | |
np.random.randint(999, 999999, size=(N, 7)), columns=list("ABCDEFG") | |
) | |
df["H"] = np.random.rand(N) | |
df["I"] = pd.util.testing.rands_array(10, N) |
This file contains 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 sqlalchemy as sa | |
from sqlalchemy import text | |
sa.Column( | |
"id", | |
sa.String, | |
nullable=False, | |
primary_key=True, | |
server_default=text( | |
"uuid_in(md5(random()::text)::cstring)::text" | |
), |
This file contains 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 'dart:async'; | |
import 'dart:io'; | |
import 'package:stop_watch_timer/stop_watch_timer.dart'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} |
This file contains 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
from datetime import datetime | |
type_mapping = { | |
str(str.__name__): str, | |
str(int.__name__): int, | |
str(float.__name__): float, | |
str(datetime.__name__): lambda x: datetime.strptime(x, "%Y%m%d"), | |
} | |
# Description: Allow changes type dinamically | |
# Usage: |
This file contains 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
function AddDecarators(mainClass){ | |
if(mainClass.isOwnser){ | |
mainClass = OwnerDecorator(mainClass); | |
} | |
if(mainClass.isEditable){ | |
mainClass = EditableDecorator(mainClass); | |
} | |
return mainClass; | |
} |
This file contains 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
let uniqueId = Date.now().toString(36) + Math.random().toString(36).substring(2); |
This file contains 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
// Colors reference | |
// You can use the following as so: | |
// console.log(colorCode, data); | |
// console.log(`${colorCode}some colorful text string${resetCode} rest of string in normal color`); | |
// | |
// ... and so on. | |
export const reset = "\x1b[0m" | |
export const bright = "\x1b[1m" | |
export const dim = "\x1b[2m" |
This file contains 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
// echo {"name": "Hernando"} | git hash-object -w --stdin -> e8ecf048cb64a124d1093c0dbd66f8679174999c | |
// git update-index --add --cacheinfo 100644 e8ecf048cb64a124d1093c0dbd66f8679174999c 1.json | |
// write-tree -> a5352b84f7a3e51bd7a233c5e3cba3e5b08b238a | |
// echo "first commit" | git commit-tree a5352b -> 1c67af28eea6615545561d677e21c123f930afa3 | |
// git show 1c67a:1.json | |
// echo {"name": "Hernando", "last_name": "Hurtado"} | git hash-object -w --stdin -> 479b607c3fbfa788d2535c082a9bc84d2955b70f | |
// git write-tree -> eff8a95d858a6049dbca21154a939016954c29f4 | |
// echo "second commit" | git commit-tree eff8a9 -p a5352b -> 2714c8a09ea110ff22ec114c9769b4c3de90ea14 |
This file contains 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
query = """ exec procedure_anme ***args """ | |
from django.db import connections | |
cursor = connections['mi_database_name_connection'].cursor() | |
cursor.execute(query) | |
cursor.nextset() | |
# retornar los resultados en forma de diccionario | |
columns = [col[0] for col in cursor.description] | |
return [dict(zip(columns, row))for row in cursor.fetchall()] |
This file contains 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
Number.prototype.mod = function(b) { | |
return ((this % b) + b) % b; | |
} | |
function mcd(a,b){ | |
if(b==0) return a; | |
return mcd(b,a.mod(b)); | |
} | |
function mcm(a,b){ |
NewerOlder