Skip to content

Instantly share code, notes, and snippets.

View VhMuzini's full-sized avatar
🎯
Focusing

VhMuzini VhMuzini

🎯
Focusing
  • Brasil
View GitHub Profile
@VhMuzini
VhMuzini / palin.py
Last active March 23, 2018 16:14
Simple python fuction for test if a string is palindrome
# Author: Vitor
word = input("Enter your word: ")
if word == word[::-1] or len(word) < 2:
print("Your word IS a palindrome")
else:
print("Your word IS NOT a palindrome")
@VhMuzini
VhMuzini / index.php
Created April 23, 2018 19:52
Separate columns in php foreach using bootstrap
<div class="row">
<? foreach ($uuids as $uuid): ?>
<div class="col-md-4">
<? component("sigpark.php", $uuid); ?>
</div>
<? endforeach; ?>
</div>
@VhMuzini
VhMuzini / index.html
Created May 8, 2018 13:56
Set style in angular2
<div class="home-component"
[style.width.px]="width"
[style.height.px]="height">Some stuff in this div
</div>
<div [style.height.%]="height">Some stuff in this div</div>
@VhMuzini
VhMuzini / index.html
Last active May 14, 2018 17:14
Progress Bar with Label behind the actual "bar" using bootstrap
<div class="progress" style="height: 20px;">
<div class="progress-bar progress-bar-stripped" role="progressbar"
aria-valuenow="25" aria-valuemin="0" aria-valuemax="100" style="width: 50%">
<span>30%</span>
</div>
</div>
@VhMuzini
VhMuzini / maps.component.ts
Created May 24, 2018 18:44
google map typeControl
let mapOptions = {
center : new google.maps.LatLng(this.device.lat, this.device.lng),
zoom : this.mapDefaultsZoom,
// maxZoom: 15,
mapTypeId: google.maps.MapTypeId.HYBRID,
mapTypeControl: true,
mapTypeControlOptions:
{
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU, // Possible Values: DEFAULT, DROPDOWN_MENU and HORIZONTAL_BAR
},
@VhMuzini
VhMuzini / night-mode.txt
Created May 24, 2018 19:08
Google map Night-mode Style
styles: [
{elementType: 'geometry', stylers: [{color: '#242f3e'}]},
{elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},
{elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},
{
featureType: 'administrative.locality',
elementType: 'labels.text.fill',
stylers: [{color: '#d59563'}]
},
{
@VhMuzini
VhMuzini / main.ts
Created July 19, 2018 19:31
Ng2-chart Bar Configuration
//Need to pass array of colors for each data to avoid grey
chartColors = [
{
backgroundColor: ['#007bff', '#007bff', '#007bff', '#007bff', '#007bff',
'#007bff', '#007bff', '#007bff', '#007bff', '#007bff',
'#007bff', '#007bff', '#007bff', '#007bff', '#007bff',
'#007bff', '#007bff', '#007bff', '#007bff', '#007bff',
'#007bff', '#007bff', '#007bff'],
@VhMuzini
VhMuzini / chart.ts
Created February 14, 2019 20:51
Chart Annotation Sample
import 'chartjs-plugin-annotation';
static chartOptions() {
const options: any = {
responsive: true,
title: {
display: true,
text: ''
},
scales: {
@VhMuzini
VhMuzini / date.ts
Created June 24, 2019 19:22
Utility date tools
import { isDate } from 'moment';
export class DateTools {
static getToday() {
return new Date();
}
@VhMuzini
VhMuzini / index.txt
Created June 26, 2020 19:05
Angular Worthy Discussions links
// Unsubscribing from observables that are not required anymore
https://stackoverflow.com/questions/38008334/angular-rxjs-when-should-i-unsubscribe-from-subscription/41177163#41177163