Skip to content

Instantly share code, notes, and snippets.

View armand1m's full-sized avatar

Armando Magalhães armand1m

View GitHub Profile
@armand1m
armand1m / comerge.sh
Last active June 6, 2018 00:17
commit, push, reset, checkout e merge branch atual com destino.
#!/bin/bash
if branch=$(git symbolic-ref --short -q HEAD)
then
echo "Branch atual: $branch"
echo
else
echo "Erro: Nenhuma branch encontrada. Provavelmente o diretório não é um repositório git."
exit
fi
@armand1m
armand1m / styles.css
Last active August 29, 2015 14:23 — forked from pburtchaell/styles.css
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/
@armand1m
armand1m / animated-pulse.css
Created June 18, 2015 16:16
Animated Pulse
@-webkit-keyframes pulse {
0 {
-webkit-transform: scale(1);
transform: scale(1);
}
50% {
-webkit-transform: scale(1.2);
transform: scale(1.2);
}
"C:\Windows\System32\cmd.exe" /c "C:\Users\armando.magalhaes\AppData\Local\Atlassian\SourceTree\git_local\bin\sh.exe" --login -i
@armand1m
armand1m / removeSSL.sh
Created August 21, 2015 12:06
Remove git ssl verification
git config http.sslVerify "false"
@armand1m
armand1m / metatag.html
Created August 31, 2015 11:39
Mobile viewport metatag
<meta name="viewport" content="width=device-width, initial-scale=1">
@armand1m
armand1m / mobileUserAgent.js
Last active September 2, 2015 13:14
Verifica se o navegador está usando um User Agent que o identifique como dispositivo mobile.
/**
* Verifica se o navegador está usando um User Agent que o identifique
* como dispositivo mobile.
*
* @return bool
* @author Armando Magalhães
*/
function hasMobileUserAgent() {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/.test(navigator.userAgent);
}
@armand1m
armand1m / TimeCounter.java
Last active December 1, 2016 16:25
Calculate between two times and applies some rules when needed. (lunch time, is between work time)
package io.github.armand1m.main;
import java.time.DayOfWeek;
import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
@armand1m
armand1m / serial_validator.c
Created November 12, 2015 00:21
bagui em c
#import <stdbool.h>
#import <string.h>
#import <stdlib.h>
#import <stdio.h>
bool is_valid(char serial[]);
void print(char serial[]);
int digit_to_int(char digit);
bool is_int_value(char digit);
int valid_serial();