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
module Sidekiq | |
module Middleware | |
module Server | |
class PublishBatchWorkerCompleted | |
def call(worker, job, queue) | |
yield | |
ensure | |
begin | |
unless worker.bid.nil? |
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 PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
<title>Faye demo</title> | |
<script src="http://localhost:3000/assets/faye-browser.js" type="text/javascript"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> | |
</head> |
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
package com.identified.helpers; | |
import org.apache.avro.Schema; | |
import org.apache.avro.io.*; | |
import org.apache.avro.specific.SpecificDatumReader; | |
import org.apache.avro.specific.SpecificDatumWriter; | |
import org.apache.avro.specific.SpecificRecordBase; | |
import java.io.ByteArrayOutputStream; |
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
hadoop-logs(){ | |
hdfs dfs -cat "/var/log/hadoop-yarn/apps/$USER/logs/$1/*" | less | |
} |
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 'benchmark' | |
def fib(n) | |
raise ArgumentError, "needs to be positive! n: #{n}" if n < 0 | |
Array.new(n, 1).tap do |seq| | |
(2..seq.length-1).each do |idx| | |
seq[idx] = seq[idx-1] + seq[idx-2] | |
end if n > 2 | |
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
data = `mvn dependency:tree` | |
matches = data.split(?\n).map{|l| l.match(/^\[INFO\][\s\|\+\-\\]+(.*)\:(?:jar|war)\:(.*)\:.*$/) }.compact | |
proj = Dir.pwd.split(?/).last | |
deps = matches.map{ |m| [ "#{m[1]}:#{m[2]}", m[1].split(?:).first, m[1].split(?:).last, m[2] ] }.uniq.sort | |
require 'csv' | |
CSV.open("../#{proj}-dependencies.csv", "w") do |csv| | |
csv << ["full name", "group id", "artifact id", "version"] |
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 "thread" | |
require "fftw3" | |
require "coreaudio" | |
require 'ruby-progressbar' | |
# progressbar = ProgressBar.create | |
# progressbar.total = 100 | |
Thread.abort_on_exception = 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
MAPPINGS = { | |
# format: "COMMON MISTAKE" => "DESIRED STATE SYMBOL" | |
"OHIO" => "OH", | |
"CALI" => "CA", | |
"CALIFORNIA" => "CA" | |
# and so on... | |
} | |
STATES = MAPPINGS.values.uniq # or possibly explicitly defined: %w(OH, CA, ...) |
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
using terms from application "Mail" | |
on perform mail action with messages theSelectedMessages for rule theRule | |
repeat with theMessageNum from 1 to count theSelectedMessages | |
set theMessage to theSelectedMessages's item theMessageNum | |
if theMessage's source contains "Content-Type: text/calendar" then | |
set mailbox of theMessage to mailbox "Calendar Invites" of account "my_account" | |
end if | |
end repeat | |
end perform mail action with messages | |
end using terms from |
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
docker% make docs | |
/Library/Developer/CommandLineTools/usr/bin/make -C docs docs | |
docker build -t "docs-base:15058-include-name-in-syslog-tag" . | |
Sending build context to Docker daemon 7.074 MB | |
Sending build context to Docker daemon | |
Step 0 : FROM docs/base:latest | |
---> 1621828e3ad8 | |
Step 1 : MAINTAINER Mary Anthony <mary@docker.com> (@moxiegirl) | |
---> Using cache | |
---> f131e0f60e41 |