Skip to content

Instantly share code, notes, and snippets.

@rbarazi
rbarazi / import_weightbot_csv_to_fitbit.rb
Last active August 29, 2015 14:18
Import Weightbot CSV to Fitbit
# 1) Backup your wieghtbot data and then download it from: https://weightbot.com/
# 2) Get a consumer_key and a consumer_secret from: https://dev.fitbit.com/apps/new
# 3) Use the key/secret from step 2 on https://dev.fitbit.com/apps/oauthtutorialpage to obtain a user_id/token/secret
# 4) install fitgem `gem install fitgem`
# 5) run the following from the console/irb
require 'fitgem'
c = Fitgem::Client.new(
:consumer_key => "",
:consumer_secret => "",
@rbarazi
rbarazi / cool_ruby_gists
Created April 18, 2013 13:29
Cool ruby gists
ruby -e '(0..23).cycle{|f|print "\r"+[128336+f].pack("U")+" ";sleep 0.2}'
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the branch/status of the current git repository
# * the branch of the current subversion repository
# * the return value of the previous command
#
# USAGE:
@rbarazi
rbarazi / airbrake_adapter.rb
Created July 4, 2012 16:26
Yell Airbrake Adapter
require 'yell'
require 'toadhopper'
class AirbrakeAdapter < Yell::Adapters::Base
setup do |options|
@env = options[:environment]
@airbrake = Toadhopper(options[:api_key])
end
write do |event|
if event.message.respond_to?(:backtrace)
@rbarazi
rbarazi / gist:2937541
Created June 15, 2012 16:51
.DS_Store git removal
find .-name .DS_Store -print0 | xargs -0 git-rm --ignore-unmatch
@rbarazi
rbarazi / haml2handlebars.rb
Created February 13, 2012 19:35
Converts haml to handlebars
#!/usr/bin/env ruby
require "rubygems"
require "haml"
class MethodMissingString < String
def method_missing(m, *args, &block)
args = args.collect do |arg|
arg.is_a?(MethodMissingString) ? arg : "\"#{arg}\""
end
(function() {
// Usage:
//
// <script src='http://pressly.com/redirect.js' type='text/javascript'></script>
// <script>Pressly.redirect("http://tablet.domain.com");</script>
//
/* >> Generated code from Issue Config */
// Supported devices to redirect
@rbarazi
rbarazi / dabblet.css
Created December 16, 2011 19:09
Untitled
p:hover:after {
content: attr(data-small);
display: block;
border: 1px solid red;
position:absolute;
bottom: 0;
right: 0;
}
@rbarazi
rbarazi / dabblet.css
Created December 16, 2011 19:09
Untitled
p:hover:after {
content: attr(data-small);
display: block;
border: 1px solid red;
position:absolute;
bottom: 0;
right: 0;
}
@rbarazi
rbarazi / dabblet.css
Created December 16, 2011 18:31
Font Techniques
/* Font Techniques */
body {
background: white;
}
p {
text-align: center;
box-shadow: inset 0px 0px 5px rgba(0,0,0,0.3);
margin: 10px auto;