Skip to content

Instantly share code, notes, and snippets.

View mckoss's full-sized avatar

Mike Koss mckoss

View GitHub Profile
@mckoss
mckoss / designer.html
Created August 8, 2014 20:54
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-item/core-item.html">
<polymer-element name="my-element" attributes="foo bar">
<template>
<style>
:host {
@mckoss
mckoss / goodbye
Created August 8, 2014 20:56
My little sumpin'
I am not here.
@mckoss
mckoss / gist:a56114f27c4a90f51502
Created March 26, 2015 21:40
Firebase Promise Wrappers
// Get Firebase value from a query as a Promise.
function getValue(ref, allowNull) {
return new Promise(function(resolve, reject) {
ref.once('value',
function(snap) {
var result = snap.val();
if (result === null && !allowNull) {
reject(new Error("No data at location: " + ref.toString()));
return;
}
T-Mobile: We have received your information and will connect you with a T-Mobile Chat Specialist soon.
T-Mobile: A Chat Specialist will be with you soon.
T-Mobile: Thank you for waiting. A Chat Specialist will be available shortly. For assistance with payment processing or account cancellation, please call Customer Care at (877) 746-0909.
T-Mobile: We appreciate your patience. A Chat Specialist will be assigned to you soon.
DarrenC: Hi, Mike!
You: HI
You: Hello?
DarrenC: Thank you for contacting T-Mobile. I'm sorry to know that you're having issues with your order.
DarrenC: No worries, I am here to help you out.
DarrenC: Let me pull up your account real quick.
The master repository for the AppEngine-Base project is stored on GitHub:
http://github.com/mckoss/appengine-base
Windows users can install the Git client: http://code.google.com/p/msysgit/
I use these settings:
- Add Git Bash Here, Add Git GUI Here
- Run Git and included Unix tools from the Windows Command Prompt
- Use OpenSSH
@mckoss
mckoss / nuggets.py
Created November 4, 2009 00:09
McNugget Problem (Knapsack)
"""
The McNugget Problem
Find the smallest n s.t. there exists a solution to:
n = 6x + 9y + 20z
for n, n+1, n+2, ... , n+5
Result is:
@mckoss
mckoss / select.py
Created November 23, 2009 22:17
Kth Largest Select in Python
def Select(a, i, first=0, last=None):
if last is None:
last = len(a)-1
p = Pivot(a, first, last)
if p == i:
return a[p]
if p < i:
return Select(a, i, p+1, last)
return Select(a, i, first, p-1)
@mckoss
mckoss / twitter-rate.html
Created November 29, 2009 22:54
Twitter Rate Calculator (JavaScript)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Twitter Rate Calculator - Find the rate that any keyword is being Twittered.</title>
<style>
table {
border-collapse:collapse;
}
p {
@mckoss
mckoss / amzn.py
Created November 30, 2009 02:36
AMZN.com Dictionary Crawler
import httplib
import urllib2
import sys
# TODO: Speed up by searching on multiple connections, say, 10
def DictSearch(sAfter):
dict = open("dict.txt")
f = open("output.csv", 'a')
@mckoss
mckoss / twitter.py
Created December 5, 2009 02:22
Simple Twitter Wrapper for Python
"""
Simple twitter API wrapper for python
Useage:
twitter = Twitter()
twitter.set_user_pass(user, passwd) - Set the user password for authenticated requests
twitter.friends_ids(user) - pass username or id to get list of all friend ids
twitter.update(text) - send an update for the current user ("tweet")