Skip to content

Instantly share code, notes, and snippets.

View lazarofl's full-sized avatar
🏃‍♂️

Lazaro Fernandes Lima Suleiman lazarofl

🏃‍♂️
View GitHub Profile
@lazarofl
lazarofl / filesize.py
Created July 26, 2024 19:13
Python function to get object size
import sys
from django.http import HttpRequest
from waffle.models import Flag, Switch
from waffle import flag_is_active, switch_is_active
from django.contrib.auth.models import User
def get_size(obj, seen=None):
"""Recursively find the size of an object."""
size = sys.getsizeof(obj)
if seen is None:
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Autoscaling for .net Web application.",
"Parameters": {
"InstanceType": {
"Description": "WebServer EC2 instance type",
"Type": "String",
"Default": "m1.small",
"AllowedValues": [
"t1.micro",
@lazarofl
lazarofl / Person.cs
Created December 2, 2018 22:35
Protoc .proto definition and .cs generated
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: Person.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
@lazarofl
lazarofl / Program.cs
Last active October 4, 2018 00:21
ASPNET Core MVC Program.cs to use appsettings json files and EnvironmentVariables configurations
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
@lazarofl
lazarofl / MeetupHololens.cs
Created May 29, 2018 17:34
Exemplo de uso das interfaces disponíveis no HoloToolkit
public class CubeManager : MonoBehaviour, IInputClickHandler, INavigationHandler, ISpeechHandler
{
public float RotationSensitivity = 10;
public bool IsRotating = false;
public void OnInputClicked(InputClickedEventData eventData)
{
gameObject.GetComponent<Renderer>().material.color = Color.red;
}
@lazarofl
lazarofl / reduce_faces.py
Created May 25, 2018 01:29 — forked from tylerlindell/reduce_faces.py
script for reducing faces programmatically with Meshlab's api
#!/usr/bin/env python
import sys
import os
import subprocess
# Script taken from doing the needed operation
# (Filters > Remeshing, Simplification and Reconstruction >
# Quadric Edge Collapse Decimation, with parameters:
# 0.9 percentage reduction (10%), 0.3 Quality threshold (70%)
@lazarofl
lazarofl / update-vs-code.sh
Last active October 24, 2018 13:44
Update VS Code for Ubuntu 64 bits from command line
wget https://vscode-update.azurewebsites.net/latest/linux-deb-x64/stable -O /tmp/code_latest_amd64.deb
sudo dpkg -i /tmp/code_latest_amd64.deb
using HoloToolkit.Unity.InputModule;
using UnityEngine;
public class HologramBehaviors : MonoBehaviour, IFocusable, IInputClickHandler
{
[SerializeField]
public bool IsRotating = false;
[SerializeField]
public Color FocusedColor = Color.red;
!function(){"use strict";angular.module("ngCalendarium",[]).constant("calendarConfig",{template:['<div class="calendarium">','<div class="header">','<button class="previous" ng-click="previousMonth()" title="previous month" ><<</button>',"<h1>{{monthLabel}}/{{yearLabel}}</h1>",'<button class="next" ng-click="nextMonth()" title="next month" >>></button>',"</div>",'<ol class="day-names clear">','<li ng-repeat="weekDay in weekDays">{{weekDay}}</li>',"</o>",'<ol class="days">','<li ng-repeat="dateContainer in dateContainers" title="{{dateContainer.state.tooltip}}">','<div ng-if="dateContainer.state.disabled" class="date disabled" ng-class="dateContainer.state.className"></div>','<div ng-if="!dateContainer.state.disabled && !isDate(dateContainer.date)" class="date empty"></div>','<div ng-if="!dateContainer.state.disabled && isDate(dateContainer.date)" ng-class="dateContainer.state.className" class="date" ng-click="selectDate(dateContainer.date,dateContainer.state)">{{dateContainer.date.getDate()}}</div>',"</li>","
@lazarofl
lazarofl / WebExtensions.cs
Last active January 13, 2016 21:52
Generic C# extension to retrieve data from web/api and convert then to an object
public static class WebExtensions
{
public static T GetResultFromWeb<T>(string url) where T : new()
{
using (var webClient = new WebClient())
{
var json_data = string.Empty;
try
{