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
| /* | |
| * Template backbone.js code that encapsulates a | |
| * datatable.net table within a view for a hypothetical ;) | |
| * auction listings application. | |
| */ | |
| var HomeRouter = Backbone.Router.extend({ | |
| routes: { | |
| 'refresh' : 'refresh', |
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 oldSync = Backbone.sync; | |
| Backbone.sync = function(method, model, options){ | |
| options.beforeSend = function(xhr){ | |
| xhr.setRequestHeader('X-CSRFToken', CSRF_TOKEN); | |
| }; | |
| return oldSync(method, model, options); | |
| }; |
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"> | |
| <title>Project Title</title> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
| <meta name="viewport" content="width=device-width"> | |
| <meta name="description" content=""> | |
| <link rel="shortcut icon" href="favicon.ico"> |
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
| #!/bin/bash | |
| # | |
| # Report time to first byte for the provided URL using a cache buster to ensure | |
| # that we're measuring full cold-cache performance | |
| while (($#)); do | |
| echo $1 | |
| curl -so /dev/null -H "Pragma: no-cache" -H "Cache-Control: no-cache" \ | |
| -w "%{http_code}\tPre-Transfer: %{time_pretransfer}\tStart Transfer: %{time_starttransfer}\tTotal: %{time_total}\tSize: %{size_download}\n" \ | |
| "$1?`date +%s`" |
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
| #!/usr/bin/env python | |
| """ | |
| A quick sync script for symbols from NFS->S3 | |
| We can't simply record the time our sync script ran and find all newer files | |
| since files with timestamps in the past may appear. So, keep track of all .txt | |
| index files that we encounter, and only sync files when there are additions | |
| to that set. | |
| """ |
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
| #!/bin/bash | |
| set -e | |
| . /home/socorro/.virtualenvs/aws/bin/activate | |
| PRIVATE_BUCKET="org.mozilla.crash-stats.symbols-private/v1" | |
| PUBLIC_BUCKET="org.mozilla.crash-stats.symbols-public/v1" | |
| TOP_DIR="/mnt/socorro/symbols" | |
| PRIVATE_DIRS="symbols_adobe" |
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
| // Documentation: https://github.com/beautify-web/js-beautify | |
| // Example URL: https://github.com/victorporof/Sublime-HTMLPrettify/blob/master/.jsbeautifyrc | |
| // Based on Airbnb's JavaScript Style Guide, URL: https://github.com/airbnb/javascript | |
| { | |
| // Collapse curly brackets | |
| "brace_style": "collapse", | |
| // Break chained method calls across subsequent lines | |
| "break_chained_methods": true, |
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
| # | |
| # Given the ID of an Amazon public AMI in one region, figure out what the | |
| # equivalent AMI IDs are for that same AMI in all other regions known. | |
| # If that AMI isn't defined in a region, it prints the region's name, but | |
| # comments it out. | |
| # | |
| from __future__ import print_function | |
| import boto3 |
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
| import boto3 | |
| def role_arn_to_session(**args): | |
| """ | |
| Usage : | |
| session = role_arn_to_session( | |
| RoleArn='arn:aws:iam::012345678901:role/example-role', | |
| RoleSessionName='ExampleSessionName') | |
| client = session.client('sqs') | |
| """ |
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
| \documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$} | |
| \XeTeXlinebreaklocale "zh" | |
| \XeTeXlinebreakskip = 0pt plus 1pt | |
| \usepackage{titlesec} | |
| \titleformat{\section}{\LARGE\filcenter}{}{1em}{} | |
| \titleformat{\subsection}{\Large\filcenter}{}{1em}{} | |
| \usepackage[T1]{fontenc} | |
| \usepackage{lmodern} | |
| \usepackage{amssymb,amsmath} | |
| \usepackage{ifxetex,ifluatex} |