Skip to content

Instantly share code, notes, and snippets.

View MuriloMazzeu's full-sized avatar
SuperCoder

Murilo Mazzeu MuriloMazzeu

SuperCoder
View GitHub Profile
@MuriloMazzeu
MuriloMazzeu / msconfig.xml
Last active October 8, 2017 22:30
HTML's Snippets
<?xml version="1.0" encoding="utf-8"?>
<!-- Please read: http://msdn.microsoft.com/en-us/library/ie/dn455106.aspx -->
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="assets/pictures/design/ms-small-tile.png"/>
<square150x150logo src="assets/pictures/design/ms-medium-tile.png"/>
<wide310x150logo src="assets/pictures/design/ms-wide-tile.png"/>
<square310x310logo src="assets/pictures/design/ms-big-tile.png"/>
<TileColor>#3498db</TileColor>
@MuriloMazzeu
MuriloMazzeu / simple-ajax.js
Last active October 8, 2017 08:03
Javascript's Snippets
const $ajax = (url, data) => new function() {
this.success
this.error
let xhr = new XMLHttpRequest();
xhr.onreadystatechange = e => {
if (xhr.readyState == 4) {
if(xhr.status == 200) this.success(xhr.responseText);
else this.error(xhr.status);
}
@MuriloMazzeu
MuriloMazzeu / CodeIgniterFunctions.php
Last active October 8, 2017 05:04
PHP's Snippets
public function is_ascii($str) {
return (preg_match('/[^\x00-\x7F]/S', $str) === 0);
}
function codificacao($string) {
return mb_detect_encoding($string.'x', 'UTF-8, ISO-8859-1');
}
function word_limiter($str, $limit = 100, $end_char = '&#8230;') {
if (trim($str) === '') return $str;
@MuriloMazzeu
MuriloMazzeu / expert-session-configs.sql
Created September 8, 2017 18:03
SQL Server's Hacks
SET DATEFIRST
SET DATEFORMAT
SET IDENTITY_INSERT
SET LANGUAGE
SET ROWCOUNT
SET SHOWPLAN_ALL
SET STATISTICS IO
SET STATISTICS TIME
@MuriloMazzeu
MuriloMazzeu / manual-signer.bat
Last active September 8, 2017 17:46
Android's CLI
keytool -genkey -v -keystore PATH_TO/MYAPP.KEYSTORE -alias MYAPP_ALIAS -keyalg RSA -keysize 2048 -validity 100000
jarsigner -sigalg SHA1withRSA -digestalg SHA1 -keystore PATH_TO/MYAPP.KEYSTORE PATH_TO/MY_UNSIGNED_RELEASE.APK MYAPP_ALIAS
zipalign -f -v 4 PATH_TO/MY_UNSIGNED_RELEASE.APK PATH_TO/MY_SIGNED_RELEASE.APK
@MuriloMazzeu
MuriloMazzeu / hyper-v-enable.bat
Last active September 8, 2017 18:07
Windows CLI's Hacks
bcdedit /set hypervisorlaunchtype auto|off
@MuriloMazzeu
MuriloMazzeu / set-session-locale.sql
Last active September 8, 2017 18:00
MySQL's Hacks
SET lc_time_names = 'pt_BR';
php -m | grep EXTENSION_NAME
@MuriloMazzeu
MuriloMazzeu / NetFrameworkProviders.txt
Last active September 8, 2017 17:52
Default ConnectionsStrings
Server=SERVIDOR; Database=NOME_DB; User Id=USUARIO; Password=SENHA;
@MuriloMazzeu
MuriloMazzeu / ForceDefaultDormatterToJSON.cs
Last active September 8, 2017 17:50
WebAPI's Snippets
config.Formatters.JsonFormatter.SerializerSettings.PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.Objects;
config.Formatters.Remove(config.Formatters.XmlFormatter);