Skip to content

Instantly share code, notes, and snippets.

💭
👨‍💻

Michael Mior michaelmior

💭
👨‍💻
Block or report user

Report or block michaelmior

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@michaelmior
michaelmior / rename-db.sh
Created Aug 26, 2011
Simple script to move all tables from one database to another. Please don't use this in production as it could fail horribly. Also, RENAME table doesn't work on views, so they won't be migrated.
View rename-db.sh
#!/bin/sh
OLD_DB=$1
NEW_DB=$2
TABLES=`echo "SHOW TABLES IN $1;" | mysql -NB`
IFS="
"
@michaelmior
michaelmior / talker-webkit.js
Created Mar 21, 2012
TalkerApp notifications for webkit
View talker-webkit.js
javascript:(function(){window.notifications={notifications_support:function(){return%20true;},notify:function(obj){if(obj.title%20!=window.notifications.prevmsg.title%20%26%26%20obj.description%20!=window.notifications.prevmsg.description){var%20not=window.webkitNotifications.createNotification('http://talkerapp.com/images/favicon.png',obj.title,obj.description);not.show();window.setTimeout(function(){not.cancel();},5000);}window.notifications.prevmsg=obj;},prevmsg:{}};})();
@michaelmior
michaelmior / MyHTTPClient.m
Created Sep 26, 2012
Override of requestWithMethod:path:parameters:
View MyHTTPClient.m
- (NSMutableURLRequest *)requestWithMethod:(NSString *)method path:(NSString *)path parameters:(NSDictionary *)parameters
{
NSURL *url = [NSURL URLWithString:path relativeToURL:self.baseURL];
OAConsumer *consumer = [[OAConsumer alloc] initWithKey:OAUTH_CONSUMER_KEY secret:OAUTH_CONSUMER_SECRET];
OAHMAC_SHA1SignatureProvider *provider = [[OAHMAC_SHA1SignatureProvider alloc] init];
OAMutableURLRequest *request = [[OAMutableURLRequest alloc] initWithURL:url consumer:consumer token:self.token realm:@"Bunch API" signatureProvider:provider];
[request setHTTPMethod:method];
[request setAllHTTPHeaderFields:self.defaultHeaders];
if ([method isEqualToString:@"GET"] || [method isEqualToString:@"HEAD"]) {
View Boxstarter
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar
Set-StartScreenOptions -EnableBootToDesktop
Install-WindowsUpdate
cinst 7zip.commandline
cinst adobereader
cinst adobeshockwaveplayer
cinst android-sdk
cinst AndroidStudio
cinst binroot
View gist:082cc479893e1efb5be5
Verifying I am +michaelmior on my passcard. https://onename.com/michaelmior
View keybase.md

Keybase proof

I hereby claim:

  • I am michaelmior on github.
  • I am michaelmior (https://keybase.io/michaelmior) on keybase.
  • I have a public key whose fingerprint is D833 5C62 4830 813F A8ED 6873 3AF1 2B9F 85C0 A026

To claim this, I am signing this object:

View MaterializedViewJoinRule.java
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to you 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
*
View start-spark.sh
#!/bin/bash -e
SPARK_VERSION="2.1.0-bin-hadoop2.7"
HADOOP_VERSION="2.7.3"
SHORT_USER=$(echo $USER | cut -d \\ -f2)
DATA_DIR=/var/tmp/$SHORT_USER/hdfs
IO_BPS=$((50 * 1024 * 1024))
function add_to_env {
host=$1
@michaelmior
michaelmior / start-spark.sh
Created May 3, 2017
Spark installation on YARN
View start-spark.sh
#!/bin/bash -ex
SPARK_VERSION="2.1.0-bin-hadoop2.7"
HADOOP_VERSION="2.7.3"
SHORT_USER=$(echo $USER | cut -d \\ -f2)
function add_to_env {
host=$1
value=$2
ssh $host "echo '$value' | sudo tee -a /etc/environment > /dev/null"
You can’t perform that action at this time.