Skip to content

Instantly share code, notes, and snippets.

@azzlack
azzlack / install_podman_m1_mac.md
Created January 18, 2024 12:49
Install Podman on M1 Mac

Steps

  1. Download and install podman from https://github.com/containers/podman/releases. Remember to use the arm verison.

  2. Configure OSX machine provider config to use apple's hypervisor

    mkdir -p ~/.config/containers
    tee ~/.config/containers/containers.conf 1> /dev/null <<EOF
    [containers]
    
    [engine]
@azzlack
azzlack / atom.cmd
Created March 10, 2017 14:37
Start Cmder from
@echo off
SET CMDER_ROOT=C:\Tools\cmder
"%CMDER_ROOT%\vendor\init.bat"
@azzlack
azzlack / transition_issue_when_added_to_or_removed_from_sprint.groovy
Last active August 31, 2021 07:02
JIRA: Transition issue when adding to or removing from sprint
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.greenhopper.service.rapid.view.RapidViewService
import com.atlassian.greenhopper.service.sprint.SprintIssueService
import com.atlassian.greenhopper.service.sprint.SprintManager
import com.atlassian.greenhopper.service.sprint.SprintService
import org.apache.log4j.Logger
import org.apache.log4j.Level
@azzlack
azzlack / CreateCertificate
Created April 30, 2015 14:33
Create development certificate for domain with root CA
@echo off
echo.
echo #####################################
echo ## Development Certificate Factory ##
echo ## ##
echo ## by azzlack ##
echo #####################################
echo.
echo Loading paths...
@azzlack
azzlack / gist:e47da479a502a8d29c28
Created March 25, 2015 09:08
Basic Umbraco Contour Workflow
/// <summary>
/// Basic Umbraco Contour Form Workflow.
/// </summary>
public class Workflow : WorkflowType
{
/// <summary>
/// Initializes a new instance of the <see cref="Workflow"/> class.
/// </summary>
public Workflow()
{
@azzlack
azzlack / changeColorLuminosity
Created February 3, 2015 07:48
Change a colors luminosity
var changeColorLuminosity = function (hexcolor, luminosity) {
var hex = hexcolor.replace(/[^0-9a-f]/gi, '');
// convert to decimal and change luminosity
var rgb = "#", c, i;
for (i = 0; i < 3; i++) {
c = parseInt(hex.substr(i * 2, 2), 16);
c = Math.round(Math.min(Math.max(0, c + (c * luminosity)), 255)).toString(16);
rgb += ("00" + c).substr(c.length);
}
@azzlack
azzlack / getContrastColor
Last active August 29, 2015 14:14
Gets the contrast color for a given color
var getContrastColor = function(hexcolor) {
var hex = hexcolor.replace(/[^0-9a-f]/gi, '');
var r = parseInt(hex.substr(0, 2), 16);
var g = parseInt(hex.substr(2, 2), 16);
var b = parseInt(hex.substr(4, 2), 16);
var yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;
return (yiq >= 128) ? 'black' : 'white';
};
@azzlack
azzlack / getColor
Last active August 29, 2015 14:14
Create color from a string
var colors = [
"8dd3c7",
"ffffb3",
"bebada",
"fb8072",
"80b1d3",
"fdb462",
"b3de69",
"fccde5",
"d9d9d9",
@azzlack
azzlack / Log4NetLogger.cs
Last active August 29, 2015 14:08
Log4Net logger for Common.Logging
namespace Common.Logging.Log4Net2
{
using System;
using System.Diagnostics;
using Common.Logging;
using Common.Logging.Factory;
using log4net.Core;
@azzlack
azzlack / gist:6935644
Created October 11, 2013 14:30
Getting auth cookie when using System.IdentityModel.Services.Tokens.MachineKeySessionSecurityTokenHandler and System.IdentityModel.Services.Tokens.SessionSecurityTokenHandler
// Need to use cookiehandler to get cookie since it's chunked. See System.IdentityModel.Services.ChunkedCookieHandler
var cookie = FederatedAuthentication.SessionAuthenticationModule.CookieHandler.Read();