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
{ | |
"countries": { | |
"AF": "Afghanistan", | |
"AL": "Albania", | |
"DZ": "Algeria", | |
"AS": "American Samoa", | |
"AD": "Andorra", | |
"AO": "Angola", | |
"AI": "Anguilla", | |
"AQ": "Antarctica", |
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
# This hosts file is brought to you by Dan Pollock and can be found at | |
# http://someonewhocares.org/hosts/zero/ | |
# You are free to copy and distribute this file for non-commercial uses, | |
# as long the original URL and attribution is included. | |
# | |
# See below for acknowledgements. | |
# Please forward any additions, corrections or comments by email to | |
# hosts@someonewhocares.org |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> | |
<title>Bootstrap 101 Template</title> | |
<!-- Bootstrap --> |
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
var gulp = require('gulp'); | |
var browserSync = require('browser-sync'); | |
gulp.task('serve', function() { | |
browserSync({ | |
server: { | |
baseDir: 'app' // Change this to your web root dir | |
} | |
}); | |
}); |
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
tell application "Google Chrome" | |
set pageUrl to get URL of active tab of first window | |
end tell | |
tell application "Safari" to add reading list item pageUrl |
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 | |
scalesvg () | |
{ | |
svgfile="$1" | |
pngdir="$2" | |
pngscale="$3" | |
qualifier="$4" | |
svgwidthxheight=$(identify "$svgfile" | cut -d ' ' -f 3) |
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
def login_required(role="ANY"): | |
def wrapper(fn): | |
@wraps(fn) | |
def decorated_view(*args, **kwargs): | |
if not current_user.is_authenticated(): | |
return current_app.login_manager.unauthorized() | |
urole = current_user.get_role() | |
if ( (urole != role) and (role != "ANY")): |
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
# In the postmkvirtualenv script I have the following to create a directory based on the project name, | |
# add that directory to the python path and then cd into it: | |
proj_name=$(echo $VIRTUAL_ENV|awk -F'/' '{print $NF}') | |
mkdir $HOME/projects/$proj_name | |
add2virtualenv $HOME/projects/$proj_name | |
cd $HOME/projects/$proj_name | |
# In the postactivate script I have it set to automatically change to the project | |
# directory when I use the workon command: |
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
<ul class="nav nav-pills pull-right"> | |
{%- for endpoint, caption in [ | |
('index', 'Index'), | |
('add_user', 'Add User') | |
] %} | |
<li{% if endpoint == request.endpoint %} class="active"{% endif %}> | |
<a href={{ url_for(endpoint) }}>{{ caption }}</a> | |
</li> | |
{%- endfor %} | |
</ul> |
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
python -c "import os; print repr(os.urandom(24))" |
NewerOlder