Skip to content

Instantly share code, notes, and snippets.

View hesenger's full-sized avatar
The art of the sailor is to leave nothing to chance

Heber Senger hesenger

The art of the sailor is to leave nothing to chance
View GitHub Profile
@hesenger
hesenger / _LOGATUALIZARESTRUTURA.sql
Last active October 23, 2018 13:53
Sql Server - Cria/atualiza uma tabela de log e sua trigger no schema especificado. O a tabela insere um registro sempre que há alteração/deleção na original.
-- _LOGATUALIZARESTRUTURA 'dbo', NULL
ALTER PROCEDURE _LOGATUALIZARESTRUTURA(@SCHEMA VARCHAR(20), @TABLE VARCHAR(20))
AS
BEGIN
/*
tipos a usar no sql server
- varchar (texto)
- int (máx 2.147.483.647) 4bytes
- tinyint (campos de tipo, máx 255) 1byte
@chrisoldwood
chrisoldwood / SpecFlow.Hooks.cs
Last active December 5, 2022 10:39
Custom SpecFlow listener and "logging" class to reduce noise when running SpecFlow tests from the command line.
using TechTalk.SpecFlow;
namespace MyCompany.SpecFlowTests
{
[Binding]
public static class Hooks
{
[BeforeFeature]
public static void BeforeFeature()
{
@sahat
sahat / client.js
Last active February 23, 2022 17:09
Calculate client-server latency using socket.io
var socket = io.connect('http://localhost');
var startTime;
setInterval(function() {
startTime = Date.now();
socket.emit('ping');
}, 2000);
socket.on('pong', function() {
latency = Date.now() - startTime;
@geuis
geuis / remote-typeahead.js
Created February 16, 2012 22:58
Remote data querying for Twitter Bootstrap 2.0 Typeahead without modifications
<script>
// Charles Lawrence - Feb 16, 2012. Free to use and modify. Please attribute back to @geuis if you find this useful
// Twitter Bootstrap Typeahead doesn't support remote data querying. This is an expected feature in the future. In the meantime, others have submitted patches to the core bootstrap component that allow it.
// The following will allow remote autocompletes *without* modifying any officially released core code.
// If others find ways to improve this, please share.
var autocomplete = $('#searchinput').typeahead()
.on('keyup', function(ev){
ev.stopPropagation();