Skip to content

Instantly share code, notes, and snippets.

View mikelopez's full-sized avatar

Marcos Lopez mikelopez

View GitHub Profile
{
"code": "RE2",
"finance": "BUY",
"parent": "RES",
"model": "RE2",
"proptype": "Condominium",
"sysid": "2919b7d3953ba9a5211bdfd369f55385",
"mls": "A11289702",
"folio": "30-42-10-005-0520",
"status": "Active",
import sys
def ask_number(msg="Enter a number"):
num = float(input(msg))
if not type(num) in [float, int]:
print("Not a number!")
ask_number(msg)
else:

Keybase proof

I hereby claim:

  • I am mikelopez on github.
  • I am sciweb (https://keybase.io/sciweb) on keybase.
  • I have a public key ASDsAROIVlwuosHJ3mBKvHBoxFt2rhGhsC9xCrpKiGcDtQo

To claim this, I am signing this object:

https://keybase.io/sciweb
@mikelopez
mikelopez / gist:0671871aa2c0593fe3b7a733b41dd295
Created August 8, 2016 03:18
text blob sns HLS_COMPLETE
{
"Type" : "Notification",
"MessageId" : "1be9ab39-3418-5325-bde9-fb18c80d88ab",
"TopicArn" : "arn:aws:sns:us-east-1:195523738124:HLS_COMPLETE",
"Subject" : "Amazon Elastic Transcoder has finished transcoding job 1470626240808-kczbjx.",
"Message" : "{\n \"state\" : \"COMPLETED\",\n \"version\" : \"2012-09-25\",\n \"jobId\" : \"1470626240808-kczbjx\",\n \"pipelineId\" : \"1439852258980-836bug\",\n \"input\" : {\n \"key\" : \"2083-28854249.mp4\"\n },\n \"outputs\" : [ {\n \"id\" : \"1\",\n \"presetId\" : \"1351620000001-000010\",\n \"key\" : \"720p/2083-28854249.mp4\",\n \"status\" : \"Complete\",\n \"statusDetail\" : \"The input file for this job contains 6 audio channels and the preset is configured for 2 audio channels. Amazon Elastic Transcoder audio-channel mapping may not result in the desired audio.\",\n \"duration\" : 6,\n \"width\" : 1280,\n \"height\" : 720\n }, {\n \"id\" : \"2\",\n \"presetId\" : \"1351620000001-000001\",\n \"key\" : \"1080p/2083
@mikelopez
mikelopez / success_order.json
Last active August 29, 2015 14:02
DBaaS - SQL order_environment successful response
{
"errors": [],
"results": [
{
"COMMENT": "Request successfully submitted.",
"METHODSTATUS": "R"
}
],
"success": true
}
@mikelopez
mikelopez / gist:7574840
Created November 21, 2013 01:58
Download binary file through HTTP
require 'open-uri'
File.open("/my/local/path/sample.flv", "wb") do |saved_file|
# the following "open" is provided by open-uri
open("http://somedomain.net/flv/sample/sample.flv", 'rb') do |read_file|
saved_file.write(read_file.read)
end
end
@mikelopez
mikelopez / gist:6662865
Last active December 23, 2015 16:29
Sample code for blogger entry
from django.views.generic import DetailView, ListView, \
TemplateView, CreateView, \
View
from django.utils.decorators import method_decorator
class IndexPage(TemplateView):
"""
Main Index Page.
"""
@mikelopez
mikelopez / gist:6117304
Created July 30, 2013 21:47
sample code for .net asterisk ami originating calls and tracing taken from http://caruizdiaz.com/?p=247 and fixed indenting
public class Dialer
{
ManagerConnection _managerConnection;
Timer _timer;
public delegate void CallFinalizedCallback(Dialer sender);
string _uniqueID = string.Empty;
bool _wasOriginated = false;
object _locker = new object();
List<HangupEvent> _hangupList = new List<HangupEvent>();
@mikelopez
mikelopez / gist:6032675
Created July 18, 2013 20:16
rfind exceptions
LOG :: 2013-07-18 15:15:37,533 ERROR Internal Server Error: /
---
Traceback (most recent call last):
File "/Library/Python/2.6/site-packages/Django-1.4.1-py2.6.egg/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/Library/Python/2.6/site-packages/Django-1.4.1-py2.6.egg/django/contrib/auth/decorators.py", line 19, in _wrapped_view
if test_func(request.user):
File "/Library/Python/2.6/site-packages/Django-1.4.1-py2.6.egg/django/contrib/auth/decorators.py", line 42, in <lambda>
lambda u: u.is_authenticated(),