Skip to content

Instantly share code, notes, and snippets.

@chaps
chaps / max_consec_repeating_char.py
Last active September 26, 2020 15:04
maximum consecutive repeating character
"""
Test:
Write a program that finds maximum consecutive repeating character in a string.
Given string: “aaabbbbbcddeeefff”.
Output of the program must return the character and the length of its biggest repeating sequence.
Output example:
Character: p
Length of the sequence: 8
"""
@chaps
chaps / README.md
Last active November 9, 2017 15:38
estimation_fixture_gather_data

Estimation fixtures gather data.

Set your env vars previous to run the gather.sh script.

estimationuser="yerusername"

estimationpassword="yerpassword"
@chaps
chaps / README.md
Last active September 11, 2017 17:45
iTexico Nova swagger response test.

Small script to test swagger endpoint response through bravado's swagger client.

Install requirements

pip install -r requirements.txt

Run the script

python testbravado.py

@chaps
chaps / test.py
Created June 28, 2017 22:51
spinner test
import logging
from logging_spinner import SpinnerHandler
import time
logger = logging.getLogger('myapp')
logger.setLevel(logging.INFO)
logger.addHandler(SpinnerHandler())
logger = logging.getLogger('myapp.logger')
logger.info('Loading data...', extra={'user_waiting': True})
@chaps
chaps / gist:7d46d165374b8e22bd614868092f6b31
Last active May 29, 2017 16:05
yagmail invalid set reset
import yagmail
email = ""
invalid_pwd = ""
valid_pwd = ""
yagmail.register(email, invalid_pwd)
try:
yag = yagmail.SMTP(email)
except Exception, e:
print e
pass
@chaps
chaps / MainActivity.java
Created March 14, 2016 20:10
Android: download and replace file for newer from url
package com.example.yeoman.downloadfile;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.AsyncTask;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
@chaps
chaps / toggle_favorite.php
Created March 14, 2016 05:22
"Web Service" for toggling the status of a favorite POST from wordpress and wordpress single favorite plugin
<?php
$post_id = null;
$site_id = null;
$host = "http://localhost/wordpress";
$url = "/wp-admin/admin-ajax.php";
echo $_SERVER['REQUEST_METHOD'];