Skip to content

Instantly share code, notes, and snippets.

View wilhsms's full-sized avatar

Wilhas Mendes wilhsms

  • Vitória, ES, Brasil
View GitHub Profile
@wilhsms
wilhsms / RolagemInfinita.js
Created September 29, 2016 14:46
Script de Rolagem Infinita
<script type="text/javascript" charset="utf-8">
var cont = 1;
var pag = 0;
$(window).scroll(function () {
if(($(window).scrollTop() + $(window).height()) > ($('body').height() - 100) ){
if(cont){
$('.loding').removeClass('hide');
setTimeout(function() {
$('.loding').addClass('hide');
carregaPagina(pag);
@wilhsms
wilhsms / export-html-table-to-excel.md
Created November 18, 2016 03:28 — forked from umidjons/export-html-table-to-excel.md
Export HTML table to Excel in AngularJS

Export HTML table to Excel in AngularJS

myApp.factory('Excel',function($window){
		var uri='data:application/vnd.ms-excel;base64,',
			template='<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>',
			base64=function(s){return $window.btoa(unescape(encodeURIComponent(s)));},
			format=function(s,c){return s.replace(/{(\w+)}/g,function(m,p){return c[p];})};
		return {
var ngAppElem = angular.element(document.querySelector('[ng-app]') || document);
ngAppElem.injector().get('$templateCache').get('template.html')
@wilhsms
wilhsms / 1.html
Created September 11, 2017 20:07 — forked from ToeJamson/1.html
Realtime Location Tracking on a Map using JavaScript
<script type="text/javascript" src="http://pubnub.github.io/eon/lib/eon-map.js"></script>
<link type="text/css" rel="stylesheet" href="http://pubnub.github.io/eon/lib/eon.css" />
<div id='map'></div>
<script type="text/javascript">
eon.map({
id: 'map',
mb_token: 'mapbox api token',
mb_id: 'mapbox map id',
subscribe_key: 'subscribe_key_here',
channel: 'my map channel'
@wilhsms
wilhsms / git.md
Created October 4, 2017 16:53 — forked from leocomelli/git.md
Lista de comandos úteis do GIT

#GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

@wilhsms
wilhsms / git.migrate
Created June 18, 2018 13:15 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@wilhsms
wilhsms / web.config
Created June 25, 2018 17:55 — forked from vmilev/web.config
Sample web.config for Angular 4 CLI app
<?xml version="1.0"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<mimeMap fileExtension=".woff2" mimeType="font/woff2" />
</staticContent>
</system.webServer>