Skip to content

Instantly share code, notes, and snippets.

View wezoalves's full-sized avatar

Weslley Alves wezoalves

View GitHub Profile
@wezoalves
wezoalves / nginx.conf
Created June 26, 2012 20:02 — forked from carlosfilho88/nginx.conf
Zend with nginx
server {
listen 80;
server_name www.zf.local zf.local;
index /index.php;
charset utf-8;
root "/home/workspace/zf/public";
access_log /var/log/nginx/zf/access.log;
error_log /var/log/nginx/zf/error.log;
@wezoalves
wezoalves / gist:3710417
Created September 12, 2012 22:23 — forked from pedroelsner/gist:3212276
Masked Input Celular
// jQuery Masked Input
$('#celular').mask("(99) 9999-9999?9").ready(function(event) {
var target, phone, element;
target = (event.currentTarget) ? event.currentTarget : event.srcElement;
phone = target.value.replace(/\D/g, '');
element = $(target);
element.unmask();
if(phone.length > 10) {
element.mask("(99) 99999-999?9");
} else {
@wezoalves
wezoalves / utils.js
Created November 27, 2012 18:19
return digit mod 10 based on a number
/**
* Author: Weslley Alves <[email protected]>
* Author URI: http://wezo.com.br
* Version: 0.0.1
* License: GNU General Public License
* License URI: http://www.wezo.com.br/blog/license/gnu-general-public-license/
*
* Examples:
* <script type="text/javascript">
*
@wezoalves
wezoalves / browsing.js
Last active October 13, 2015 20:29
navigation url hash
/**
* Author: Weslley Alves <[email protected]>
* Author URI: http://wezo.com.br
* Version: 0.0.1
* License: GNU General Public License
* License URI: http://www.wezo.com.br/blog/license/gnu-general-public-license/
*
* Examples:
* <script type="text/javascript">
*
@wezoalves
wezoalves / ClickHeat.js
Created January 11, 2013 20:32
save positions clicks into page
var collectionsClicks = new Array();
var observerClicks = function(event) {
var info = new Object();
info.position = {};
info.position.click_x = event.x;
info.position.click_y = event.y;
info.position.screenX = event.screenX;
@wezoalves
wezoalves / Calendar.java
Last active December 14, 2015 08:49
JAVA - Calendar
// get times
Calendar now = Calendar.getInstance();
int year = now.get(Calendar.YEAR);
int month = now.get(Calendar.MONTH); // Note: zero based!
int day = now.get(Calendar.DAY_OF_MONTH);
int hour = now.get(Calendar.HOUR_OF_DAY);
int minute = now.get(Calendar.MINUTE);
int second = now.get(Calendar.SECOND);
int millis = now.get(Calendar.MILLISECOND);
/*-----------------------------------------------------------------*
| CalculaDigitoMod11(Dado, NumDig, LimMult) |
| Retorna o(s) NumDig Dígitos de Controle Módulo 11 do |
| Dado, limitando o Valor de Multiplicação em LimMult: |
| |
| Números Comuns:: iDigSaida iCod |
| CGC 2 9 |
| CPF 2 12 |
| C/C,Age - CAIXA 1 9 |
| habitação/bloqueto 1 9 |
<script type="text/javascript" src="js/bootstrap-datepicker.js"></script>
<div id="datepicker"></div>
<script type="text/javascript">
$('#datepicker').datepicker().on('changeDate', function(ev){
var element = angular.element($('#datepicker'));
var controller = element.controller();
var scope = element.scope();
scope.$apply(function(){
@wezoalves
wezoalves / youtube-feeds.md
Created October 1, 2017 01:34 — forked from tracend/youtube-feeds.md
Youtube Feeds
https://www.youtube.com/feeds/videos.xml?channel_id=CHANNELID
https://www.youtube.com/feeds/videos.xml?user=USERNAME
https://www.youtube.com/feeds/videos.xml?playlist_id=PLAYLISTID

Notes:

You can get the channel id by searching for the attribute data-channel-external-id in the source code of the youtube page

@wezoalves
wezoalves / tailwind.navigation.html
Created August 29, 2023 19:05
navigation tailwind html
<header class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-4 py-12 mb-0 pb-0">
<div class="container mx-auto">
<nav>
<div class="sm:hidden relative w-11/12 mx-auto bg-white rounded">
<div class="absolute inset-0 m-auto mr-4 z-0 w-6 h-6">
<svg xmlns="http://www.w3.org/2000/svg" class="dark:stroke-zinc-950 stroke-gray-50" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" />
<polyline points="8 9 12 5 16 9" />
<polyline points="16 15 12 19 8 15" />
</svg>