Skip to content

Instantly share code, notes, and snippets.

View AlbertoMonteiro's full-sized avatar
😎
Writting every day lines fo happy code

Alberto Monteiro AlbertoMonteiro

😎
Writting every day lines fo happy code
View GitHub Profile
@cmilfont
cmilfont / djs.js
Created March 9, 2011 14:13
djr_controller.rb
Array.prototype.add = function(el) {
this[this.length] = el;
return this;
};
function toMap(object) {
var arr = [];
for(var item in object) arr[arr.length] = {key: item, value: object[item]};
return arr;
};
@AlbertoMonteiro
AlbertoMonteiro / ScrollPositionBehavior.cs
Created February 11, 2012 04:10
Custom WP7 Behaviors
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Interactivity;
namespace Custom.Behaviors
{
public class ScrollPositionBehavior : Behavior<ScrollViewer>
{
public double Position
@AlbertoMonteiro
AlbertoMonteiro / Windows Context Menus.reg
Last active November 8, 2015 16:18
Set of Windows Context Menu helpers
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\vs14cmd]
@="Visual Studio 2015 Command Line"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\vs14cmd\command]
@="cmd.exe /s /k pushd \"%V\" && call \"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\VsDevCmd.bat\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\vs14cmd]
@="Visual Studio 2015 Command Line"
@AlbertoMonteiro
AlbertoMonteiro / IgnoreCertificate.cs
Last active June 19, 2017 12:09
Ignorar certificado no WebClient (IgnoreCertificate)
ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;
@AlbertoMonteiro
AlbertoMonteiro / DecompileMigrationScript.csx
Last active August 1, 2017 19:54
Decompile migration
#r "System.Xml"
#r "System.Xml.Linq"
#r "System.IO.Compression"
#r "System.Data"
using System.Xml.Linq;
using System.IO.Compression;
using System.Data.SqlClient;
public void DecompressDatabaseMigration(string migrationName, string databaseName)
@AlbertoMonteiro
AlbertoMonteiro / collations.md
Created August 10, 2017 12:14
Collation Sql Server ignorar acentos, cedilha e case
@AlbertoMonteiro
AlbertoMonteiro / delete_order_version_elastic_beanstalk.js
Last active September 6, 2017 19:26
Script to delete order version of Elastic Beanstalk in AWS Console
jQuery("table").find("input[type=checkbox]").each((i,e) => { setTimeout(() => { if(i >= 100) jQuery(e).click(); }, 0); })
@AlbertoMonteiro
AlbertoMonteiro / comandos.md
Created December 13, 2017 12:57
Docker sucesso
docker run -it --mount source=my-vol,target=c:/app microsoft/dotnet-framework powershell
docker network ls
docker volume create my-vol
docker volume inspect my-vol
@fragsalat
fragsalat / decorator.js
Created February 27, 2019 23:38
Aurelia computedFrom array of objects
import {Parser, Expression, ComputedExpression, Binding, Scope, createOverrideContext} from 'aurelia-binding';
class ComputedListExpression extends Expression {
/**
* @param {String} expressionStr Expression string for one dependency
*/
constructor(expressionStr: string) {
super();
const parser = new Parser();
[user]
name = Alberto Monteiro
email = alberto.monteiro@live.com
[core]
preloadindex = true
fscache = true
autocrlf = true
editor = code -n -w
[alias]
fetchall = fetch --all --prune