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
@app.route('/account/edit', methods=['GET', 'POST']) | |
@login_required | |
def edit_account(): | |
sp = app.stormpath_manager.client | |
form = AccountForm(request.form, obj=user, | |
company_name=user.custom_data.get('company', None)) | |
if form.validate_on_submit(): | |
try: | |
_user = sp.accounts.get(user.href) | |
_user.email = form.email.data |
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
angular.module('myModule', []).controller('ctrl', function($scope) { | |
}).directive('overflowY', ['$window', '$document', function($window, $document) { | |
return { | |
link: function(scope, element, attrs) { | |
var w = angular.element($window); | |
var raw = element[0]; | |
var atBottom = false, |
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
any(group.name == "admin" for group in user.groups) |
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
backup: # mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql | |
restore:# mysql -u root -p[root_password] [database_name] < dumpfilename.sql |
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
function prettyJSON(obj) { | |
console.log(JSON.stringify(obj, null, 2)); | |
} | |
// obj -> value to convert to a JSON string | |
// null -> (do nothing) | |
// 2 -> 2 spaces per indent level |
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
<rule name="san aspx"> | |
<!--Removes the .aspx extension for all pages.--> | |
<match url="(.*)" /> | |
<conditions logicalGrouping="MatchAll"> | |
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> | |
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> | |
</conditions> | |
<action type="Rewrite" url="{R:1}.aspx" /> | |
</rule> |
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
zip -rv9 myzipfile.zip /mydir |
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
$ nohup ./myprogram > foo.out 2> foo.err < /dev/null & |
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
<!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"> | |
<title>Bootstrap 101 Template</title> | |
<!-- Bootstrap --> | |
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet"> |
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
'use strict'; | |
var users = require('../sample_users'); | |
exports.seed = function(knex, Promise) { | |
var userPromises = []; | |
users.forEach(function(user){ | |
userPromises.push(createUser(knex, user)); | |
}); | |
return Promise.all(userPromises); | |
}; |