Skip to content

Instantly share code, notes, and snippets.

@keirbadger
keirbadger / k8sdash.sh
Created April 11, 2019 08:01
Script to automatically login to EKS Kubernetes dashboard using aws-iam-authenticator (from Mac)
kubectl config use-context new-prod;aws-iam-authenticator token -i [CLUSTER NAME] -r [AWS IAM ACCOUNT WITH ACCESS TO EKS] | jq -r .status.token |pbcopy
kill -9 $(ps -ef | grep "kubectl proxy" | grep -v grep | cut -c6-13)
kubectl proxy &
python k8sdash_login.py
@tonyklawrence
tonyklawrence / teamcity.coffee
Last active December 29, 2015 01:59
Dashing Teamcity Widget
class Dashing.Teamcity extends Dashing.Widget
@accessor 'state', Dashing.AnimatedValue
onData: (data) ->
if data.status
$(@get('node')).attr 'class', (i,c) -> c.replace /\bstatus-\S+/g, ''
$(@get('node')).addClass "status-#{data.status}"
@davefp
davefp / LICENSE.md
Last active April 1, 2021 04:30
Weather Widget for Dashing

The MIT License (MIT)

Copyright (c) 2014 David Underwood

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@timoxley
timoxley / drop_collections.js
Created July 27, 2012 17:30
mongoose drop collections helper
var async = require('async')
var _ = require('underscore')
var Helpers = function(mongoose) {
this.mongoose = mongoose || require('mongoose')
this.dropCollections = function(callback) {
var collections = _.keys(mongoose.connection.collections)
async.forEach(collections, function(collectionName, done) {
var collection = mongoose.connection.collections[collectionName]
@fwielstra
fwielstra / api.js
Created June 14, 2011 14:46
An example NodeJS / Mongoose / Express application based on their respective tutorials
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')