I hereby claim:
- I am adrianpike on github.
- I am adrianpike (https://keybase.io/adrianpike) on keybase.
- I have a public key ASBP5KHHMa5rjc4RMAqTrRocTCxPhivxYiXrUqigzoavpAo
To claim this, I am signing this object:
#!/usr/bin/env ruby | |
require 'socket' | |
require 'time' | |
$file = ARGV[0] || "opt/ardexa/sma/logs/{}/latest.csv" | |
puts "Streaming readings from #{$file}..." | |
sock = TCPSocket.new 'localhost', 2003 |
function find_filename() { | |
if [ "$1" != "" ] | |
then | |
find . -not -path '*/\.*' | grep -i $1 | |
else | |
echo "Need a filename" | |
fi | |
} | |
alias ff=find_filename |
I hereby claim:
To claim this, I am signing this object:
# https://blog.nvisium.com/2015/06/using-rails-5-attributes-api-today-in.html | |
class Foobar | |
def initialize | |
@foobar = '123' | |
end | |
end |
require 'active_resource' | |
class ActiveResource::ConnectionError | |
def to_s | |
message = super | |
message << " Response body = #{response.body}." if response.respond_to?(:body) | |
message | |
end | |
end |
-- Put this into your Outlook scripts folder (~/Library/Application Support/Microsoft/Office/Outlook Script Menu Items/) | |
on run {} | |
tell application "Microsoft Outlook" | |
set msgs to current messages | |
if ((count of msgs) < 1) then return | |
set mailFolders to mail folders | |
repeat with fld in mailFolders | |
if (name of fld is "Archived") then |
I hereby claim:
To claim this, I am signing this object:
counts: { | |
foo: { | |
a: 50 | |
b: 60 | |
} | |
bar: { | |
a: 6312 | |
} | |
zulu:{ | |
c: 21 |
foo = ['a','b','c'] | |
bars = _.map(foo, function(obj) { | |
return 'a' + obj; | |
}) | |
#### VS #### | |
bars = 'a' + obj for obj in foo |
class MagicalPresenter < Draper::Base | |
extend ActiveModel::Naming | |
include ActiveModel::Conversion | |
attr_reader :changes | |
def initialize(model, opts = {}) | |
@changes = {} | |
super(model) | |
end |