This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import urlparse | |
import SimpleHTTPServer | |
import BaseHTTPServer | |
class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
def do_GET(self): | |
url = urlparse.urlparse(self.path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#1) on https://console.developers.google.com/ register project and associate API from library | |
# OUTPUT: client_id,client_secret | |
client_id="..." | |
client_secret="...." | |
#2) get authorization code at the following link using web browser | |
# OUTPUT: code | |
scope="https://www.googleapis.com/auth/drive" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
textutil -convert html -stdout file.rtf | pandoc --from=html --to=markdown --out=file.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tutorial https://www.daimto.com/how-to-get-a-google-access-token-with-curl/ | |
# YouTube video https://youtu.be/hBC_tVJIx5w | |
# Client id from Google Developer console | |
# Client Secret from Google Developer console | |
# Scope this is a space seprated list of the scopes of access you are requesting. | |
# Authorization link. Place this in a browser and copy the code that is returned after you accept the scopes. | |
https://accounts.google.com/o/oauth2/auth?client_id=[Application Client Id]&redirect_uri=http://127.0.0.1&scope=[Scopes]&response_type=code | |
# Exchange Authorization code for an access token and a refresh token. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hash | |
def dig(*path) | |
path.inject(self) do |location, key| | |
location.is_a?(Hash) ? location[key] : nil | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// tests/acceptance/foo-test.js | |
// Assert that text should be found | |
assert.hasText('Not Found'); // Error: Could not find text "Not Found" on the page | |
// Provide custom message | |
assert.hasText('Not Found', 'Expected to find "Not Found"'); // Error: Expected to find "Not Found" | |
// Find any number of elements containing the query text | |
text('Found'); // [<div>Found</div>, <input value="Found">] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from "ember"; | |
const AUTO_EMAIL_RE = /([\w.!#\$%+-]+@[\w-]+(?:\.[\w-]+)+)/; | |
const AUTO_LINK_CRE = [/<[^>]+$/, /^[^>]*>/]; | |
const AUTO_LINK_RE = /(?:((?:ed2k|ftp|http|https|irc|mailto|news|gopher|nntp|telnet|webcal|xmpp|callto|feed|svn|urn|aim|rsync|tag|ssh|sftp|rtsp|afs|file):)\/\/|(www\.))([^\s<]+)/; | |
var autoLink = function (text, context) { | |
var buffer = []; | |
if (context.autoLink) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# /share/CE_CACHEDEV1_DATA/.qpkg/autorun/autorun-plexconnect.sh | |
# | |
# mkdir /share/CE_CACHEDEV1_DATA/.qpkg/autorun | |
# chmod +x /share/CE_CACHEDEV1_DATA/.qpkg/autorun/autorun-plexconnect.sh | |
curl -Lk https://gist.githubusercontent.com/plasticine/86e189c42ac8ec7598a8/raw/update_plex_connect.sh | bash & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This pre-commit hook checks that you havn't left and DONOTCOMMIT tokens in | |
# your code when you go to commit. | |
# | |
# To use this script copy it to .git/hooks/pre-commit and make it executable. | |
# | |
# This is provided just as an example of how to use a pre-commit hook to | |
# catch nasties in your code. |
NewerOlder