Skip to content

Instantly share code, notes, and snippets.

View slattery's full-sized avatar

Mike Slattery slattery

View GitHub Profile
@russellpierce
russellpierce / athena.R
Created January 14, 2017 17:23
Connect to AWS Athena using R (with the option to use IAM credentials)
#repsych is on github and is here only for the glibrary idiom
library(repsych)
#install and load the following packages
glibrary(whisker, lubridate, magrittr, rappdirs, awsjavasdk, rJava)
if (!aws_sdk_present()) {
install_aws_sdk()
}
load_sdk()
@leonawicz
leonawicz / app.R
Last active March 14, 2021 06:27
Use custom local image files as icons in a Shiny Dashboard value box
#
# This Shiny web application demonstrates the use of custom image files
# in place of icons for value boxes in Shiny Dashboard by overriding two
# functions:
#
# 'icon' from the shiny package and 'valueBox' from the shinydashboard package.
#
# Each function adds minimal, specific additional handling of image files.
# Note: A custom css file must also be included so that value boxes can
# display the icons. For that reason, do not expect images in place of icons to
@kewang
kewang / git-merge-test.sh
Last active February 23, 2023 10:04
Git merge dry-run
#!/bin/sh
BRANCH=$1
git merge --no-commit --no-ff $1; git status; git merge --abort
# References: https://stackoverflow.com/questions/501407/is-there-a-git-merge-dry-run-option
@tzmartin
tzmartin / embedded-file-viewer.md
Last active May 29, 2024 08:23
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@maxvt
maxvt / infra-secret-management-overview.md
Last active February 28, 2024 20:53
Infrastructure Secret Management Software Overview

Currently, there is an explosion of tools that aim to manage secrets for automated, cloud native infrastructure management. Daniel Somerfield did some work classifying the various approaches, but (as far as I know) no one has made a recent effort to summarize the various tools.

This is an attempt to give a quick overview of what can be found out there. The list is alphabetical. There will be tools that are missing, and some of the facts might be wrong--I welcome your corrections. For the purpose, I can be reached via @maxvt on Twitter, or just leave me a comment here.

There is a companion feature matrix of various tools. Comments are welcome in the same manner.

@micahstubbs
micahstubbs / .block
Last active November 10, 2018 23:22
Chatty Map II
license: MIT
border: none
height: 510
@nadav-dav
nadav-dav / dom2comp.js
Created March 15, 2016 10:37
React: Getting a component from a DOM element
let searchRoot = ReactDom.render(React.createElement(Main), document.getElementById('main'));
try {
var getComponent = (comp) => comp._renderedComponent ? getComponent(comp._renderedComponent) : comp;
var getComponentById = (id)=> {
var comp = searchRoot._reactInternalInstance;
var path = id.substr(1).split('.').map(a=> '.' + a);
if (comp._rootNodeID !== path.shift()) throw 'Unknown root';
while (path.length > 0) {
comp = getComponent(comp)._renderedChildren[path.shift()];
@lopspower
lopspower / README.md
Last active May 31, 2024 12:19
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@paullewis
paullewis / requestIdleCallback.js
Last active February 21, 2024 16:56
Shims rIC in case a browser doesn't support it.
/*!
* Copyright 2015 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@caseywatts
caseywatts / svg_to_png.js
Last active May 3, 2016 13:03
convert svg to png inline
// modified from answers on http://stackoverflow.com/questions/5433806/convert-embedded-svg-to-png-in-place
// Takes an SVG element as target
function svg_to_png_data(target) {
var ctx, mycanvas, svg_data, img, child;
// Construct an SVG image
var new_width = target.width.baseVal.valueInSpecifiedUnits;
var new_height = target.height.baseVal.valueInSpecifiedUnits;