Skip to content

Instantly share code, notes, and snippets.

View dudash's full-sized avatar
🎸
Be excellent to each other

Jason Dudash dudash

🎸
Be excellent to each other
View GitHub Profile
@dudash
dudash / toStringVectorPrependZeros
Last active August 29, 2015 14:04
R code to convert a vector of ints to common width strings by prepending 0's
# \fn
# \brief Get common width strings from a list of numbers
# \param 'numbers' is an integer vector of numbers
# \return A vector of strings normalized to the same width
#
# Example:
# inputof: 5,6,7,8,9,10,11
# outputs: 05,06,07,08,09,10,11
toStringVectorPrependZeros <- function(numbers)
@dudash
dudash / README.md
Last active November 27, 2016 23:23
Star Wars Quotes Edge Bundling Viz
@dudash
dudash / oc-cpdcenv.sh
Last active December 22, 2015 19:11
OpenShift CLI command to copy environment vars from one deployment config to another
# TODO turn this into a shell script
# oc env dc [source dc] --list | grep [filter] | oc env dc [dest dc] -e -
# if you want to stomp (--overwrite specified)
# oc env dc [source dc] --list | grep [filter] | oc env dc [dest dc] --overwrite -e -
@dudash
dudash / togglehiddenfiles.sh
Last active December 22, 2015 23:19
Toggle hidden files on OSX on and off
#!/bin/bash
# Note that in file dialog boxes you can just type "CMD+Shift+."
CURRENT_VALUE=`defaults read com.apple.finder AppleShowAllFiles`
if [ $CURRENT_VALUE == 1 ] ; then
defaults write com.apple.finder AppleShowAllFiles -boolean false
else
defaults write com.apple.finder AppleShowAllFiles -boolean true
fi
killall Finder
@dudash
dudash / openshift-workshop_20160818.md
Last active September 9, 2016 15:39
Open Shift Workshop - August 18, 2016
@dudash
dudash / xam-rhmap-initandlogin.cs
Last active November 27, 2016 23:21
Xamarin RHMAP Init Async - Snippet
public async void initRHMAPAndLogin()
{
try
{
bool inited = await FHClient.Init();
if (inited)
{
Console.WriteLine("FH init success");
FH.SetLogLevel(1);
string authPolicy = "XamDemo";
// Make a call to a cloud REST endpoint (be sure enclosing func is marked async)
String helloName = "emptyItem";
if (item != null && item.Name != null) { helloName = item.Name; }
Console.WriteLine("Calling Cloud.....");
var response = await FH.Cloud("hello", "GET", null, new Dictionary<string, string>() { { "hello", helloName } });
if (response == null)
{
Console.WriteLine("EXCEPTION!");
}
else if (response.Error == null)
@dudash
dudash / swift-30-centos7-bc.yaml
Last active January 23, 2017 20:51
This a custom build config (defined in yaml) that can be used in OpenShift to create a S2I docker image. For use with `oc create`
kind: "BuildConfig"
apiVersion: "v1"
metadata:
name: "swift-30-centos7-build"
spec:
triggers:
- type: "GitHub"
github:
secret: "secret101"
source:
@dudash
dudash / swift-30-centos7-is.yaml
Created January 23, 2017 16:39
This is a image stream resource (defined in yaml) that can be used to put a Swift S2I image into the Open Shift registry
apiVersion: v1
kind: ImageStream
metadata:
name: swift
annotations:
openshift.io/display-name: Swift
spec:
tags:
- name: '3.0'
annotations:
@dudash
dudash / npmls.bash
Created February 17, 2017 19:41
NPM aliases for your shell
alias npmlsg="npm list -g --depth=0 2>/dev/null"
alias npmls="npm list --depth=0 2>/dev/null"