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
#!/usr/bin/env python3 | |
import sys | |
# Map the uppercase letters forwards: | |
_MAPPING = { | |
'Q': 'P', | |
'W': 'O', |
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
<?xml version="1.0" encoding="utf-8"?> | |
<feed xmlns:im="http://itunes.apple.com/rss" xmlns="http://www.w3.org/2005/Atom" xml:lang="en"> | |
<id>https://itunes.apple.com/us/rss/topmusicvideos/limit=200/explicit=true/xml</id><title>iTunes Store: Top Music Videos</title><updated>2016-06-22T20:09:58-07:00</updated><link rel="alternate" type="text/html" href="https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewTop?cc=us&id=1&popId=5"/><link rel="self" href="https://itunes.apple.com/us/rss/topmusicvideos/limit=200/explicit=true/xml"/><icon>http://itunes.apple.com/favicon.ico</icon><author><name>iTunes Store</name><uri>http://www.apple.com/itunes/</uri></author><rights>Copyright 2008 Apple Inc.</rights> | |
<entry> | |
<updated>2016-06-22T20:09:58-07:00</updated> | |
<id im:id="1125405366">https://itunes.apple.com/us/music-video/this-is-what-you-came-for/id1125405366?uo=2</id> | |
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
# XXX -- Top level review comments: | |
# | |
# * Nice exception recovery and logging. | |
# | |
# * Please cleanup code formatting. | |
# This is a little rough on my eyes. | |
# | |
# * Should we use this as template for other | |
# short network element scripts? | |
# |
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
from nettools import NetworkElement | |
with NetworkElement('171.0.2.45') as ne: | |
for route in ne.routing_table: | |
print '%15s -> %s' % (route.name, route.ipaddr) |
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
gem install do_postgres -- \ | |
--with-pgsql-server-dir=/Applications/Postgres.app/Contents/Versions/9.3 \ | |
--with-pgsql-server-include=/Applications/Postgres.app/Contents/Versions/9.3/include/postgresql/server |
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
# /etc/nginx/nginx.conf | |
# For more information on configuration, see: | |
# * Official English Documentation: http://nginx.org/en/docs/ | |
# * Official Russian Documentation: http://nginx.org/ru/docs/ | |
user nginx; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log; |
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
# /etc/nginx/conf.d/bidder.conf | |
upstream unicorn { | |
server unix:/srv/bidder/shared/unicorn.sock fail_timeout=0; | |
} | |
server { | |
listen 80 default deferred; |
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
['/old', '/old2'].each do |path| | |
get path do | |
# Deprecated: Please call `/new` instead. | |
warn "[DEPRECATION] `#{path}` is deprecated. Please call `/new` instead." | |
url = '/new' | |
url += "?#{request.query_string}" unless request.query_string.empty? | |
redirect to(url), 301 | |
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
- jquery_1x = 'jquery-1.11.0-beta2.min.js' | |
- jquery_2x = 'jquery-2.1.0-beta2.min.js' | |
/[if lt IE 9] | |
-# The user is on an ancient browser. Load jQuery 1.x from the CDN. | |
%script{src: "http://code.jquery.com/#{jquery_1x}"} | |
-# If loading jQuery from the CDN fails, then load our local copy. | |
:javascript | |
window.jQuery || document.write( |
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
require 'data_mapper' | |
module Appends | |
module InstanceMethods | |
# This module contains methods that we'll make available as instance | |
# methods on DataMapper resources. | |
def vomit | |
throw :halt | |
end |