This file contains hidden or 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
from flask import Flask, request, render_template | |
from flaskext.wtf import Form, FloatField, Required | |
app = Flask(__name__) | |
app.secret_key = 'b\xcaf\xde\xc3\xc6\xdc\x03\xf0ls\xd6\x08\xe7\x9a2\x02j\xdf\xa7n\xe5\xf4\xdd' | |
class ChangeForm(Form): | |
cost = FloatField("Total cost of item: $") | |
tender = FloatField("Amount tendered: $") | |
This file contains hidden or 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
;;; Directory Local Variables | |
;;; For more information see (info "(emacs) Directory Variables") | |
((nil . ()) | |
(python-mode . ((python-environment-directory . "~/Envs") | |
(python-environment-virtualenv | |
'("virtualenv" "--system-site-packages" "--quiet" "--python" "/home/matt/Envs/api/bin/python")) | |
(jedi:environment-root . "api")))) |
This file contains hidden or 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
(defun git-link-cs-stash (hostname dirname filename branch commit start end) | |
(cl-destructuring-bind (project-name repo-root) (split-string dirname "/") | |
(format "http://stash.cs.sys/projects/%s/repos/%s/browse/%s#%s" | |
project-name | |
repo-root | |
filename | |
(if end | |
(format "%s-L%s" start end) | |
(format "%s" start))))) |
This file contains hidden or 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
_complete_ssh_hosts () | |
{ | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \ | |
cut -f 1 -d ' ' | \ | |
sed -e s/,.*//g | \ | |
grep -v ^# | \ | |
uniq | \ | |
grep -v "\[" ; |
This file contains hidden or 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
$ sudo gem install -V chef | |
HEAD https://rubygems.org/latest_specs.4.8.gz | |
302 Moved Temporarily | |
HEAD https://rubygems.global.ssl.fastly.net/latest_specs.4.8.gz | |
200 OK | |
GET https://rubygems.org/latest_specs.4.8.gz | |
302 Moved Temporarily | |
GET https://rubygems.global.ssl.fastly.net/latest_specs.4.8.gz | |
200 OK | |
HEAD https://rubygems.org/specs.4.8.gz |
This file contains hidden or 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
<img width=3D"0" = | |
height=3D"0" class=3D"mailtrack-img" src=3D"https://mailtrack.io/trace/mail= | |
/b1a26fa29fb695ebc040620a19033f6879ba8161.png"> |
This file contains hidden or 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
# This invocation of awscli outputs the value of the 'Environment' tag of the EC2 instance. | |
FACTER_environment=$(aws ec2 describe-tags \ | |
--region us-east-1 \ | |
--filters Name=tag:Environment,Values=* \ | |
--query Tags[?ResourceId==\`$(ec2metadata --instance-id)\`].Value \ | |
--output text) \ | |
puppet apply --modulepath=/opt/puppet/modules -e "include core,apps::engage,apache2,pgbouncer,memcached,courseload::apps::api,apps::eventprocessing" |
This file contains hidden or 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
func videoOrientation() { | |
let previewConn = self.previewLayer?.connection | |
let orientation = UIApplication.sharedApplication().statusBarOrientation | |
switch orientation { | |
case UIInterfaceOrientation.LandscapeLeft: | |
previewConn!.videoOrientation = AVCaptureVideoOrientation.LandscapeLeft | |
case UIInterfaceOrientation.LandscapeRight: | |
previewConn!.videoOrientation = AVCaptureVideoOrientation.LandscapeRight | |
case UIInterfaceOrientation.Portrait: |
This file contains hidden or 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
var Shim = { | |
context: { | |
onLocationChanged: function() { | |
console.log("Location changed!"); | |
} | |
}, | |
activateDebugMode: function() { | |
console.log("Debug mode activated!"); | |
}, |
This file contains hidden or 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
def palindrome_test2(candidate): | |
if not isinstance(basestring, candidate): | |
raise TypeError("The argument to this function must be a string.") | |
alphanum_chars = [l for l in candidate if l != " "] | |
for idx, i in enumerate(alphanum_chars, 1): | |
if i == alphanum_chars[-idx]: | |
continue | |
else: |