Skip to content

Instantly share code, notes, and snippets.

View garettmd's full-sized avatar
🌩️
Cloudy with a chance of automation 🤖

Garett Dunn garettmd

🌩️
Cloudy with a chance of automation 🤖
View GitHub Profile
@garettmd
garettmd / elevator.js
Last active August 29, 2015 14:14
Elevator Saga 2nd Challenge
{
init: function(elevators, floors) {
var elevator1 = elevators[0];
elevator1.on("idle", function() {
elevator1.goToFloor(0);
});
elevator1.on("floor_button_pressed", function(floorNum){
elevator1.goToFloor(floorNum);
});

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
class PickitSession(FlaskView):
route_base = '/'
def __init__(self):
self.CONSUMER_KEY = '41815-cd31a16ee9750c7a782f9cde'
self.ACCESS_TOKEN = ''
self.REDIRECT_URI = 'http://127.0.0.1:5000'
self.OAUTH_REQUEST_URL = 'https://getpocket.com/v3/oauth/request'
self.AUTH_URL = 'https://getpocket.com/auth/authorize'
self.OAUTH_ACCESS_URL = 'https://getpocket.com/v3/oauth/authorize'
#!/usr/bin/env python3
import json
import webbrowser
import requests as r
from flask import Flask, request
from flask.ext.classy import FlaskView, route
import sys
import easygui as eg
@garettmd
garettmd / main.html
Created December 11, 2015 22:34
the main points the JS portion
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<head>
{% if title %}
<title>{{ title }} - PickPocket</title>
{% else %}
<title>PickPocket</title>
{% endif %}

Keybase proof

I hereby claim:

  • I am garettmd on github.
  • I am garettmd (https://keybase.io/garettmd) on keybase.
  • I have a public key ASBrlraXCkpGS8upJb0v5usZ6y_w4cKXxnYY26hPRIiczgo

To claim this, I am signing this object:

@garettmd
garettmd / app.js
Last active July 22, 2016 16:24
troubleshooting jquery
$(document).ready(function() {
alert("jquery is working!");
$('.article-table-row').on('mouseenter', function() {
$(this).addClass('.hovered');
$(this).children().css('background-color', 'transparent');
$(this).find('.list-item')
});
$(".article-table-row").on('mouseleave', function() {
$(this).removeClass('.hovered');
@garettmd
garettmd / python.json
Last active March 9, 2017 15:55
Click setup.py snippet for VSCode (and probably other editors)
"click setup": {
"prefix": "click",
"body": [
"from setuptools import setup",
"",
"setup(",
"\tname='<app name>',",
"\tversion='<version #>',",
"\tpy_modules=['<yourscript>'],",
"\tinstall_requires=[",
@garettmd
garettmd / reflect.py
Created March 29, 2017 19:12 — forked from huyng/reflect.py
A simple echo server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
@garettmd
garettmd / 1_README.md
Last active June 4, 2019 19:42 — forked from Daniel15/1_README.md
Complete Google Drive File Picker example

Google Drive File Picker Example

This is an example of how to use the Google Drive file picker and Google Drive API to retrieve files from Google Drive using pure JavaScript. At the time of writing (14th July 2013), Google have good examples for using these two APIs separately, but no documentation on using them together.

Note that this is just sample code, designed to be concise to demonstrate the API. In a production environment, you should include more error handling.

See a demo at http://stuff.dan.cx/js/filepicker/google/