Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Coding !

Marcel Caraciolo marcelcaraciolo

💭
Coding !
View GitHub Profile
@marcelcaraciolo
marcelcaraciolo / aula-06-exercicio-visualizacao.ipynb
Created April 20, 2023 01:14
Aula 06 - Exercicio Visualizacao.ipynb
View aula-06-exercicio-visualizacao.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@marcelcaraciolo
marcelcaraciolo / checkdependencies.py
Created September 5, 2022 13:15
check dependencies example
View checkdependencies.py
import subprocess
def check_dependencies():
"""Ensure required tools for installation are present.
"""
print("Checking required dependencies")
for cmd, param, url in [("git", '--version', "http://git-scm.com/"),
@marcelcaraciolo
marcelcaraciolo / sample.tcx
Created August 12, 2022 21:02
Sample Running TCX file
View sample.tcx
<?xml version='1.0' encoding='UTF-8'?>
<TrainingCenterDatabase xmlns:ext="http://www.garmin.com/xmlschemas/ActivityExtension/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2">
<Activities>
<Activity Sport="Running">
<Id>2012-12-26T21:29:53Z</Id>
<Notes>Aerobics</Notes>
<Lap StartTime="2012-12-26T21:29:53Z">
<TotalTimeSeconds>608.47</TotalTimeSeconds>
<DistanceMeters>1609.34399414</DistanceMeters>
<MaximumSpeed>4.55431461334</MaximumSpeed>
@marcelcaraciolo
marcelcaraciolo / docker-compose.yml
Created February 15, 2022 14:59
Geninfo Docker-Compose Demo YAML File
View docker-compose.yml
version: "2"
services:
web:
build: .
#command: python3 manage.py runserver 0.0.0.0:8000
command: bash -c "pip install -r requirements.txt && gunicorn geninfo.wsgi:application --bind 0.0.0.0:8000"
volumes:
- .:/usr/src/
expose:
@marcelcaraciolo
marcelcaraciolo / vms.py
Created February 1, 2021 13:58
Xenserver functions for snapshots, export XVA Backup
View vms.py
import functions
class VMs(object):
def __init__(self, name, uuid, sr_uuid):
self.name = name
self.uuid = uuid
#-------------------------#
#Info about vms snapshots, templates and vdi/vm backup
#sr-uuid is the storage place where vdi is.
#-------------------------#
@marcelcaraciolo
marcelcaraciolo / admin.py
Created February 25, 2015 13:25
Simple admin example
View admin.py
# -*- coding: utf-8 -*-
import xlwt
from django.contrib import admin
from django.http import HttpResponse
from models import (PaymentForm, Order, OrderItem,
Discount, Affiliate)
from forms import DiscountForm
@marcelcaraciolo
marcelcaraciolo / vm.py
Created July 19, 2014 04:35
example vm
View vm.py
class VM(object):
def __init__(self, uuid, name, status):
self.uuid = uuid
self.name = name
self.status = status
def __repr__(self):
return '%s - %s (%s)' % (self.uuid, self.name, self.status)
def export(self, directory_name=None):
@marcelcaraciolo
marcelcaraciolo / example.py
Last active August 29, 2015 14:04
example command
View example.py
def can_pipe(command, fastq_file):
'''
bwa-mem handles longer (> 70bp) reads with improved piping.
Randomly samples 5000 reads from the first two million.
Default to no piping if more than 75% of the sampled reads are small.
'''
min_size = 70
thresh = 0.75
head_count = 8000000
tocheck = 5000
View node_digit_dependencies.js
var express = require('express')
, routes = require('./routes')
, http = require('http')
, path = require('path')
, fs = require('fs')
, uuid = require('uuid')
, yhat = require('yhat');
var app = express();
var yh = yhat.init("your username", "your apikey");
View digits_deploy.py
from yhat import BaseModel, Yhat
class DigitModel(BaseModel):
def require(self):
from PIL import Image
from StringIO import StringIO
import base64