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
# Import a blog post. | |
def ingest(external_post) | |
map = AuthorExternalMap.find_by_external_id(external_post.author_id) | |
if map.present? | |
author = Author.where(id: map.author_id).include(posts: [:categories]).try(:first) | |
category = Category.find_or_create_by!(name: external_post.category_name) | |
post = find_existing_post(external_post) | |
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
# Import a blog post. | |
def ingest(external_post) | |
map = nil | |
MyStatsd.client.time('find_map') do | |
map = AuthorExternalMap.find_by_external_id(external_post.author_id) | |
end | |
if map.present? | |
author = nil | |
MyStatsd.client.time('find_author') do |
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
{ | |
"default" : "https://phabricator.whatever.com/" | |
} |
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
Error attempting to use stored discovery information: <openid.consumer.consumer.TypeURIMismatch: Required type http://specs.openid.net/auth/2.0/signon not found in ['http://specs.openid.net/auth/2.0/server', 'http://openid.net/srv/ax/1.0', 'http://specs.openid.net/extensions/ui/1.0/mode/popup', 'http://specs.openid.net/extensions/ui/1.0/icon', 'http://specs.openid.net/extensions/pape/1.0'] for endpoint <openid.consumer.discover.OpenIDServiceEndpoint server_url='https://www.google.com/accounts/o8/ud' claimed_id=None local_id=None canonicalID=None used_yadis=True >> |
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 "./test2.rb" | |
def hi_replacement | |
puts "new thing" | |
end | |
hi = hi_replacement | |
hi |
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 | |
CHUNK=5 | |
MYSQL_CMD="SHOW SLAVE STATUS\G" | |
MYSQL="/usr/bin/mysql" | |
GREP="grep Sec" | |
START=$(echo $MYSQL_CMD|$MYSQL|$GREP|cut -d: -f2) | |
i=0 | |
function slaving_stopped { |
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
policy = """{ | |
"Statement":[{ | |
"Effect":"Allow", | |
"Action":["s3:*"], | |
"Resource":["arn:aws:s3:::mybucket"]}]}""" | |
import boto | |
c = boto.connect_iam() | |
instance_profile = c.create_instance_profile('myinstanceprofile') | |
role = c.create_role('myrole') | |
c.add_role_to_instance_profile('myinstanceprofile', 'myrole') |
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
{ | |
"index": { | |
"analysis": { | |
"filter": { | |
"autocomplete_filter": { | |
"type": "edge_ngram", | |
"min_gram": "1", | |
"max_gram": "20" | |
}, | |
"word_joiner": { |
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
"word_joiner": { | |
"type": "word_delimiter", | |
"catenate_all": true | |
} |
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/sh | |
set -e | |
# An example hook script to verify what is about to be pushed. Called by "git | |
# push" after it has checked the remote status, but before anything has been | |
# pushed. If this script exits with a non-zero status nothing will be pushed. | |
# | |
# This hook is called with the following parameters: | |
# |
OlderNewer