Skip to content

Instantly share code, notes, and snippets.

@cmenscher
cmenscher / importS3Csv.gs
Created June 8, 2018 21:44 — forked from katylava/importS3Csv.gs
Google Apps Script to import a CSV, stored securely on S3, to a Google Spreadsheet
var AWS_KEY = '<your key>';
var AWS_SECRET = '<your secret>';
function generateS3Url(bucket, path) {
var expiresDt = Math.floor(Date.now() / 1000) + (60 * 60 * 24); // can be up to 7 days from now
var stringToSign = 'GET\n\n\n' + expiresDt + '\n/' + bucket + '/' + encodeURIComponent(path);
var hmac = Utilities.computeHmacSignature(Utilities.MacAlgorithm.HMAC_SHA_1, stringToSign, AWS_SECRET, Utilities.Charset.UTF_8);
var signed = encodeURIComponent(Utilities.base64Encode(hmac));
@cmenscher
cmenscher / importS3Csv.gs
Created June 8, 2018 21:44 — forked from katylava/importS3Csv.gs
Google Apps Script to import a CSV, stored securely on S3, to a Google Spreadsheet
var AWS_KEY = '<your key>';
var AWS_SECRET = '<your secret>';
function generateS3Url(bucket, path) {
var expiresDt = Math.floor(Date.now() / 1000) + (60 * 60 * 24); // can be up to 7 days from now
var stringToSign = 'GET\n\n\n' + expiresDt + '\n/' + bucket + '/' + encodeURIComponent(path);
var hmac = Utilities.computeHmacSignature(Utilities.MacAlgorithm.HMAC_SHA_1, stringToSign, AWS_SECRET, Utilities.Charset.UTF_8);
var signed = encodeURIComponent(Utilities.base64Encode(hmac));
@cmenscher
cmenscher / README.md
Created September 6, 2016 20:57 — forked from mems/README.md
Fix AdressBook errors in OSX 10.11

For /var/log/system.log full of errors like these ones:

kernel[0]: Sandbox: com.apple.Addres(XXXXX) deny(1) network-outbound /private/var/run/mDNSResponder
com.apple.AddressBook.InternetAccountsBridge[XXXXX]: dnssd_clientstub ConnectToServer: connect()-> No of tries: 1
com.apple.AddressBook.InternetAccountsBridge[XXXXX]: dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:4 Err:-1 Errno:1 Operation not permitted

How to fix it?

Keybase proof

I hereby claim:

  • I am cmenscher on github.
  • I am cmenscher (https://keybase.io/cmenscher) on keybase.
  • I have a public key ASCg82YtOAwFwNMGrIr-gIx2EaiimadVDloHjibdImDF8Qo

To claim this, I am signing this object:

@cmenscher
cmenscher / gist:14818671155979f1cdffddfa241b206f
Created March 8, 2017 22:08
Business Models and Operating Models
Business Models and Operating Models
(This reading is assembled from blogs at ashridgeonoperatingmodels.com)
What is the difference between a business model and an operating model and who cares? First, I don’t think that it matters how you define terms like business model or operating model or business architecture. But it does help to be consistent. In this blog I will offer some definitions, not because I think they are more right than other definitions but because, in order to develop definitions, you need to think through all the moving parts.
For me a business model is the larger concept. An operating model is a part of a business model. An operating model is the engine at the heart of the business model that helps make the business model work.
A business model defines the following
- the stakeholders with whom the organisation will interact
- the offer or promise that the organisation is making to each stakeholder segment
(customers, employees, investors, suppliers, etc both internal and external)
- th

Last updated: 2015-08-11

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

The State of Smartphones in 2013: Part I of the new Ars Ultimate Guide
Enlarge / More phones than you can shake a phone at.
Andrew Cunningham
It's been just under a year since the last time we examined the state of the smartphone. The intervening months have brought us the expected annual hardware refreshes and software updates, but it's striking just how similar things are at a high level.
Apple and Samsung are still standing at the top of the field, and at the moment there's not a strong third-place contender in sales or in reach. HTC continues to be down on its luck despite the critical darling that is the HTC One. LG is still taking pages from Samsung's playbook, trying lots of odd ideas in an effort to differentiate. Microsoft is still struggling to improve Windows Phone 8's standing with consumers, developers, and hardware partners. All of this is more or less as it was a year ago.
OS X 10.9 Mavericks: The Ars Technica Review
Aurich Lawson / Thinkstock
After a dozen years and nine major releases, OS X has had a full life: the exuberance of youth, gradually maturing into adulthood, and now, perhaps, entering its dotage. When I am an old operating system I shall wear… leather?
The 2011 release of OS X 10.7 Lion seemed to mark the natural endpoint of the "big cat" naming scheme. But Apple couldn't resist the lure of the "cat, modifier cat" naming pattern, releasing OS X 10.8 Mountain Lion a year later. Perhaps it just wanted to give its cat nine lives.
The 10th major release, OS X 10.9 Mavericks, is named after an awkwardly plural California surfing spot, finally ending the feline dynasty. But what part of the operating system's existence is this? The afterlife?
@cmenscher
cmenscher / fu_ascii
Created August 22, 2013 15:10
‹^› ‹(•¿•)› ‹^›
‹^› ‹(•¿•)› ‹^›
@cmenscher
cmenscher / gist:5864427
Created June 26, 2013 02:58
Updated code in CVViewController.m file in Cordova XCode project to disable scrollbars when scrolling.
// prevent webView from bouncing
// based on the DisallowOverscroll/UIWebViewBounce key in config.xml
if (!bounceAllowed) {
if ([self.webView respondsToSelector:@selector(scrollView)]) {
((UIScrollView*)[self.webView scrollView]).bounces = NO;
[((UIScrollView*)[self.webView scrollView]) setShowsHorizontalScrollIndicator:NO];
[((UIScrollView*)[self.webView scrollView]) setShowsVerticalScrollIndicator:NO];
} else {
for (id subview in self.webView.subviews) {
if ([[subview class] isSubclassOfClass:[UIScrollView class]]) {