Skip to content

Instantly share code, notes, and snippets.

View mickdelaney's full-sized avatar

mick delaney mickdelaney

View GitHub Profile
@mickdelaney
mickdelaney / .gitconfig-linux
Last active August 19, 2023 09:25
.gitignore (linux)
[alias]
co = checkout
st = status
ci = commit
ad = add -A .
pm = push origin master
pl = pull origin master
[core]
editor = code --wait
[pull]
[user]
name = someone
email = someone@somewhere.com
[alias]
st = status
ci = commit
ad = add -A .
pm = push origin master
pl = pull origin master
[core]
@mickdelaney
mickdelaney / index.html
Created December 7, 2019 23:31 — forked from belDom/index.html
Step wizard with flexbox
<div ng-app="stepWizardApp" ng-controller="stepWizardCtrl">
<ol class="step-wizard">
<li ng-repeat="step in steps" ng-class="stepStyle($index)"ng-click="">
<span class="number-circle" ng-bind="step.number"></span>
<span class="step-name" ng-bind="step.name"></span>
</li>
</ol>
</div>
@mickdelaney
mickdelaney / README.md
Created July 29, 2017 15:37 — forked from kentcdodds/README.md
upload-file

upload-file angular-formly type

This is my upload-file type for what I use at work. We use angular-upload for the upload service to do the actual file uploading. We also have several abstractions and use ES6 that may confuse you a little bit (sorry about that). Hopefully this gets you started though.

@mickdelaney
mickdelaney / postgres_queries_and_commands.sql
Created May 24, 2017 21:24 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@mickdelaney
mickdelaney / ssh-proxy-command-multi-hop
Created February 10, 2017 11:42
ssh proxy command
Host proxy-host
Hostname host1
port 22
User username
RequestTTY yes
ForwardAgent yes
IdentityFile /key-for-proxy.pem
Host target-host
Hostname host2
@mickdelaney
mickdelaney / pyspark-udf.py
Created January 8, 2017 20:13 — forked from zoltanctoth/pyspark-udf.py
Writing an UDF for withColumn in PySpark
from pyspark.sql.types import StringType
from pyspark.sql.functions import udf
maturity_udf = udf(lambda age: "adult" if age >=18 else "child", StringType())
df = sqlContext.createDataFrame([{'name': 'Alice', 'age': 1}])
df.withColumn("maturity", maturity_udf(df.age))
@mickdelaney
mickdelaney / mt3-filter-with-windsor-scope
Last active March 21, 2016 13:45
masstransit3 filter with windsor scope issue
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Castle.MicroKernel.Registration;
using Castle.Windsor;
using MassTransit;
using MassTransit.Internals.Extensions;
using MassTransit.TestFramework;
using MassTransit.Pipeline;
@mickdelaney
mickdelaney / gist:b6e9f1ff3ab94ac93ac2
Created January 30, 2016 20:19 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
  1. General Background and Overview
@mickdelaney
mickdelaney / delete-bin-&-obj-directories.ps1
Created January 29, 2016 11:04
delete all bin & obj directories
Get-ChildItem .\ -include bin,obj -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }