Skip to content

Instantly share code, notes, and snippets.

View tonholis's full-sized avatar

Cleyton T tonholis

View GitHub Profile
@tonholis
tonholis / deleteGridFSChunks.js
Created July 3, 2019 15:04
A NodeJS script to delete 'orphan' chunks in MongoDB/GridFS database
//How to run:
// node deleteGridFSChunks.js <hostname> <databaseName>
const { MongoClient } = require('mongodb');
const args = process.argv.slice(2);
async function main() {
if (args.length != 2)
{
console.info("Warning\nTwo arguments are required: Hostname and database name");
return;
@tonholis
tonholis / app.py
Last active November 10, 2023 15:44
Python consumer that works with MassTransit
import sys
import pika
import json
import re
import logging
import logging.handlers
PUBLISHER_EXCHANGE_NAME = 'DoSomeJob'
CONSUMER_QUEUE_NAME = 'python_consumer_queue'
@tonholis
tonholis / example.php
Last active September 6, 2017 15:33
Laravel and Store Procedures with Output parameters
/*
This example shows how to execute a stored procedured in MySQL in Laravel 5.3 and get the output values.
*/
//Input params
$search = 'test';
$page = 1;
$perPage = 10;
//Output values
@tonholis
tonholis / WrapPanel.cs
Last active May 19, 2017 22:37
My Xamarin.Forms Bindable WrapPanel
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
@tonholis
tonholis / Program.cs
Created April 6, 2017 19:54
HackerRank Booking.com - Customer Service Capacity
/*
Problem: Determine how many people need to hire
Input specs:
- first line contains the current number of customer service executives
- second line contains a number of records in data set
- next linkes contains a pair of timestamps representing a start of call and end of call
Input demo:
1
@tonholis
tonholis / AwesomeWrappanel
Last active January 25, 2018 03:28 — forked from NicoVermeir/AwesomeWrappanel
Support for removing items event from ItemsSource in Wrappanel
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using Xamarin.Forms;
namespace WrapPanelDemo.Controls
{
public class AwesomeWrappanel : Layout<View>
{
@tonholis
tonholis / MY_Form_validation.php
Last active August 29, 2015 14:19
MY_Form_validation
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class MY_Form_validation extends CI_Form_validation
{
function __construct()
{
parent::__construct();
log_message('debug', "MY_Form_validation Class Initialized");
}