Skip to content

Instantly share code, notes, and snippets.

View bryan3561's full-sized avatar
😂

Bryan Contreras bryan3561

😂
View GitHub Profile
@bryan3561
bryan3561 / output.json
Created May 5, 2023 15:08
compromisos de monta
[{
"jockeyId": 25614,
"id": 6,
"inscripcion": {
"jockeyComprometidoId": 6,
"cuidadorId": 16930,
"capatazId": 20,
"serenoId": 75791,
"peonId": 26641,
"lugarCuidaId": 3,
{
"carreraTipoId": 21,
"pistaEstadoId": 2,
"pistaTipoId": 1,
"reunionGlobalId": 221,
"id": 171230,
"nombre": "DANCING AGAIN (ALT)",
"carreraCondicion": "ALTERNATIVA, Yeguas, de 3 a 3a ,ganadas desde 0 hasta 0, ARENA CODO NUEVO, distancia 1100m\r",
"carreraTipo": {
"carreraTipoGrupoId": 6,
@bryan3561
bryan3561 / index.html
Last active October 15, 2021 15:25
naty
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Novoplos</title>
<meta content="" name="description">
<meta content="" name="keywords">
CREATE DATABASE INTACT
ON (FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\DATA\INTACT.MDF'),
(FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\DATA\INTACT_LOG.LDF')
FOR ATTACH;
@bryan3561
bryan3561 / masonry.html
Created November 2, 2017 07:30
masonry example easy
<script src="https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js"></script>
<!-- or -->
<script src="https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.js"></script>
<script>
@bryan3561
bryan3561 / num_comments_shares_fb.php
Created May 24, 2017 22:02
Obtener el número de comentario y compartidas que tiene una url en Facebook
<?php
$url_a_consultar = 'https://www.google.co.ve';
$url = "http://graph.facebook.com/{$url_a_consultar}";
$response = json_decode( file_get_contents( $url ) );
# Toda la info que te entrega Facebook en esta consulta..
var_dump( $response );
echo "comentarios del enlace: " . $response->share->comment_count ."<br>";
@bryan3561
bryan3561 / functions.php
Last active May 24, 2017 20:05
Como tener rápidamente las visitas de mashared y las compartidas para usarlas donde se quiera consumiendo menos recursos
<?php
if ( ! function_exists( 'bkc_meta_views_shares' ) ) {
function bkc_meta_views_shares( $post_id = null ) {
$post_meta = [];
static $posts_metas = [];
/*
* Si el ID no fue pasado, se asigna automaticamente el del post
* que esta siendo leido en el momento donde se uso la funcion.
*/
@bryan3561
bryan3561 / size_folder.sh
Created April 3, 2017 22:13
Saber cuando pesa las carpetas del directorio que se elija
du -hs * | sort -nr | head -200
@bryan3561
bryan3561 / tagsDefault.php
Created January 16, 2017 18:32
colocar un Tag por defecto en los post de WordPress
<?php
# Si no existe, crea la funcion
if (!function_exists('rl_establecer_tag_por_defecto')) {
function rl_establecer_tag_por_defecto($post_id,$post) {
# Que solo sea con los post u que este publicado
if ( ($post->post_type == 'post') && ($post->post_status == 'publish') ) {
# Establecer el o los Tags separados por coma (,)
wp_set_post_tags( $post_id, 'NOMBRE_DEL_TAG', true );
}
@bryan3561
bryan3561 / recortarTitulo.php
Created January 13, 2017 15:21
Recortar los títulos en WordPress con PHP usando elipsis
<?php
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
$post_the_title = get_the_title();
if (strlen($post_the_title) > 55) {
$post_the_title = substr($post_the_title, 0, 55) . '...';
}
?>