Skip to content

Instantly share code, notes, and snippets.

View vinicius-stutz's full-sized avatar
🐢
I may be slow to respond.

Vinícius Stutz vinicius-stutz

🐢
I may be slow to respond.
View GitHub Profile
@vinicius-stutz
vinicius-stutz / part1.md
Created April 24, 2018 22:38
Using DataTables with C# and Web API

Using DataTables with Web API Part 1: Making a simple GET Request

I've faced this need several times over the years:

So, we've got our dashboard, and we need to show customer/user/whatever data in a table so we can search, sort, filter, all that good stuff...

Sound familiar? Well, there are a few ways we could approach this. To start with, we could put it all together by hand. Creating the table structure and binding each individual row from a data source. But that's loads of work! What we need is some kind of helper or plugin to make our lives easier. Something that will turn our ordinary table into a powerhouse of searchable goodness.

Enter DataTables...

@vinicius-stutz
vinicius-stutz / parte01.md
Created April 24, 2018 03:37
Mapeamento com Entity Framework Code First (Fluent Api)

Qual a diferença entre Data Annotations e Fluent Api?

Quando usado o mapeamento por Data Annotations, as propriedades das entidades POCO (Plain Old CLR Object) são decoradas com atributos, fazendo necessário referência externa, além da “sujeira” dos metadados.

public int ClienteId {get; set;}
[MaxLength(150), Required]
public string Nome { get; set; }

No Fluent Api usamos métodos encadeados fora das entidades, as mesmas permanecem “limpas”, porém precisamos escrever mais código.

@vinicius-stutz
vinicius-stutz / dbms_app_info_set_module.sql
Last active November 17, 2016 18:19
How to write an information in the V$SESSION table using the current user session in Oracle Database
/*
* HOW TO WRITE AN INFORMATION IN THE V$SESSION TABLE USING THE
* CURRENT USER SESSION IN ORACLE DATABASE.
*/
-- EXAMPLE OF RECORDING INFORMATION
BEGIN
DBMS_APPLICATION_INFO.SET_MODULE('ANY_ID', 'YOUR INFO HERE');
END;
@vinicius-stutz
vinicius-stutz / sample.js
Created July 11, 2016 19:24
Remove jQuery Plugin Instances
var $element = $('div#test');
// You can examine all of the events attached to an element
$._data($element.get(0), 'events');
// Remove namespaced events added using .on()
$element.off('pluginNamespace');
// Remove namespaced events added using .bind()
$element.unbind('.pluginNamespace');
@vinicius-stutz
vinicius-stutz / sample.html
Created June 2, 2016 20:09
Encode String with Base64 in Javascript
<!-- Add some tags here, head, title etc and your references -->
<p>
<label>Codificada:</label>
<span id='1'></span>
</p>
<p>
<label>Limpa:</label>
<span id='2'></span>
</p>
@vinicius-stutz
vinicius-stutz / README.md
Last active March 16, 2016 18:51
Query string via JavaScript

How to make query string in JavaScript

This is an equivalent function to the method of C# Request.QueryString, in order to return the URL parameters derived

@vinicius-stutz
vinicius-stutz / README.md
Created December 30, 2015 13:41
Google Chrome Favicons For Bookmarklets

Google Chrome Favicons For Bookmarklets

  1. Open the Bookmark Manager and export your bookmarks;
  2. Open the exported html file in your favorite editor and look for the bookmarklet you want a favicon applied to;
  3. Convert the 16x16 px (or greater) favicon you want to use into the BASE64 format (I used Base64 Image Encoder);
  4. Now you can add the favicon via adding the ICON="data:image/insert-your-base64-image-code-here" attribute in the link;
  5. Save the file and import it in the bookmark manager.

Done! If the favicon doesn’t show up, try clicking on the bookmarklet. Afterwards the changes should stick and you can delete the imported bookmarks folder. If you have sync activated the favicons on your bookmarklets will also show up on your other PC, Mac, smartphone etc.

@vinicius-stutz
vinicius-stutz / README.md
Last active December 29, 2015 13:31
CSS3: Navicon Transformicons
@vinicius-stutz
vinicius-stutz / README.md
Last active July 23, 2024 16:51
Máscara p/ telefones com 8 ou 9 dígitos (jquery.mask.js)
@vinicius-stutz
vinicius-stutz / README.md
Created November 16, 2015 01:22
Release Change in Wallpaper (Windows)

Release Change in Wallpaper (Windows)

Open the Windows Registry Editor (can be a text editor) and do:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\ActiveDesktop]
"NoChangingWallPaper"=dword:00000000

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System]