Skip to content

Instantly share code, notes, and snippets.

Ricardo Diaz cubanx

Block or report user

Report or block cubanx

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View build.ps1
function build($pathToSolution, $configuration) {
if (-not $configuration) {
$configuration = "Debug"
}
& (Join-Path ${env:ProgramFiles(x86)} "MSBuild\14.0\Bin\msbuild.exe") /p:Configuration=$configuration /v:minimal $pathToSolution
}
View RetryUntil.cs
using System;
using System.Diagnostics;
namespace ClassLibrary1
{
public static class Retry
{
public static void Until(Action stuffToRetry, Func<bool> stopWhenTrue, TimeSpan? timeToRetry = null)
{
var internalTimeToRetry = timeToRetry ?? 5.Seconds();
@cubanx
cubanx / Powershell Class Outline
Created Sep 26, 2016 — forked from rgborck/Powershell Class Outline
This is an outline of a PowerShell class I taught to my coworkers in the fall of 2015
View Powershell Class Outline
Powershell - Lesson 1
Configuration:
Powershell profile
Import-Module Grc
(Test it w/ `Get-GrcTenants`)
Syntax:
Variable declaration $
Powershell variables ( $true, $null, $false, etc )
Control Structures
Conditionals (-eq, -ne, -contains, etc)
@cubanx
cubanx / releaseplan
Last active Aug 29, 2015
Prod deployment workflow
View releaseplan
#When something goes wrong...
###Deploy `master` to UK, find a bug at some point during the week.
This scenario is the one we're hoping will happen the most of the least likely scenarios :) (Yeah, kinda confusing sentence, but read it again)
* `DARLENE` is deployed to UK on Friday and it's master as of midnight Thursday.
* `CHARLIE` is the lagged release deployed to US on the same Friday.
* `EDNA` is the release that started the moment the first commit went in after midnight on Thursday on master
View gist:5348924
// ==UserScript==
// @name Pivotal Biggify
// @description Makes Pivotal usable on a big board
// @include https://*.pivotaltracker.com/*
// ==/UserScript==
if (location.hostname == 'www.pivotaltracker.com') {
setInterval(function() {
document.getElementById('header').style.display = 'none';
document.getElementById('controlPanel').style.display = 'none';
View WhenAPublicationIsFound.cs
[Test]
public void It_should_play() {
int completeAttestations = 38;
int totalAttestations = 84;
Expect(Math.Round((double)((completeAttestations * 100) / totalAttestations)), EqualTo(Math.Round(completeAttestations * 100d / totalAttestations)));
var actualUnrounded = (double)((completeAttestations * 100) / totalAttestations);
var expectedUnrounded = completeAttestations * 100d / totalAttestations;
Expect(actualUnrounded, EqualTo(expectedUnrounded), "Actual: <{0}>, Expected: <{1}>".FormatWith(actualUnrounded, expectedUnrounded));
@cubanx
cubanx / AutoHotkey.ahk
Created Mar 29, 2012
File for quake like console with AutoHotkey
View AutoHotkey.ahk
;Hide the script's tray icon
#NoTrayIcon
;Use the same icon of console.exe for the script's tray icon (note that "#NoTrayIcon" hide the default one and any other icon, you must delete or coment "#NoTrayIcon" in order to show this icon in taskbar)
:Menu, Tray, Icon, console.exe, 1
; Launch console if necessary; hide/show on Win+`
;You can coustomise this by yourself #=Win, !=Alt, ^=Ctrl, +=Shift, see (http://www.autohotkey.com/docs/Hotkey.htm - http://www.autohotkey.com/docs/KeyList.htm )
#`::
DetectHiddenWindows, on
View DashboardControllerTests.cs
using System;
using System.Web;
using System.Web.Mvc;
using Moq;
using NUnit.Framework;
using TNW.Reporting.Domain.Common;
using TNW.Reporting.Domain.Entities.User;
using TNW.Reporting.Domain.Managers;
using TNW.Reporting.Test.Common;
using TNW.Reporting.Web.Controllers;
View WhenAUserHasADefaultDashboard.cs
using System.Web.Mvc;
using Moq;
using NUnit.Framework;
using Specs.Core;
using Specs.Reporting.Mixins;
using TNW.Common.nHibernate;
using TNW.Reporting.Web.Controllers;
namespace Specs.Reporting.Web.Controllers
{
@cubanx
cubanx / git-aliases.sh
Created Feb 7, 2012
My git.config global aliases
View git-aliases.sh
git config --global alias.slog "log -n 10 --format=format:'%Creset%an %Cgreen%ar:%Creset%s %Cred%h'"
git config --global alias.ci "!git add -A && git commit"
git config --global alias.tracking "for-each-ref --format='%(refname:short) <- %(upstream:short)' refs/heads"
git config --global alias.s "status --short"
You can’t perform that action at this time.