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
$:.unshift "#{File.dirname(__FILE__)}/lib" | |
require "swagger" | |
# Get request API endpoints | |
require "index_api" | |
require "project_name_api.rb" | |
require "project_path_api.rb" | |
# Post request endpoints |
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/runscala.sh -DskipErrors com.wordnik.swagger.codegen.BasicRubyGenerator http://churn.picoappz.com/api-docs "key" | |
base path is http://churn.picoappz.com/api-docs | |
********* Failed to read swagger json! | |
Error: Operation - responseClass | missing required field | |
**** ignoring errors and continuing | |
swagger version: 1.2 | |
basePath: | |
api version: 1.0 | |
missing models: Set() | |
---------- |
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
Crepes with veggies: http://projects.washingtonpost.com/recipes/2013/07/10/ratatouille-tomato-crepes/ | |
Corn cakes, if there is still any corn tomorrow: http://www.nytimes.com/recipes/1014967/sweet-corn-blini.html | |
Stuffed peppers: http://www.nytimes.com/recipes/1014968/feta-stuffed-peppers.html | |
Chili mac and cheese; http://www.gracelaced.com/2011/09/26/baked-green-chile-mac-and-cheese/ |
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
# do this opposed to each_with_object or inject | |
# from http://phrogz.net/tap-vs-each_with_object | |
by_id = {}.tap{ |h| items.each{ |item| h[item.id] = item } } |
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
# logstash config | |
input { | |
syslog { | |
type => syslog | |
port => 514 | |
} | |
} | |
output { | |
stdout { debug => true debug_format => "json"} |
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 ruby | |
require 'rest_client' | |
require 'net/http' | |
require 'benchmark' | |
URL = 'https://www.livingsocial.com/deals/753290-tacos-and-margaritas-for-two-or-four' | |
time = Benchmark.realtime do | |
(1..100).each { | |
url = URI.parse(URL) | |
req = Net::HTTP::Get.new(url.path) |
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
Facebook is one of the most feature-rich apps available for Android. With features like push notifications, news feed, and an embedded version of Facebook Messenger (a complete app in its own right) all working together in real-time, the complexity and volume of code creates technical challenges that few, if any, other Android developers face--especially on older versions of the platform. (Our latest apps support Android versions as old as Froyo--Android version 2.2--which is almost three years old.) | |
One of these challenges is related to the way Android's runtime engine, the Dalvik Virtual Machine, handles Java methods. Late last year we completed a major rebuild of our Android app (https://www.facebook.com/notes/facebook-engineering/under-the-hood-rebuilding-facebook-for-android/10151189598933920), which involved moving a lot of our code from JavaScript to Java, as well as using newer abstractions that encouraged large numbers of small methods (generally considered a good programming practice). Unfortuna |
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
#when scripting against rvm with a terminal shell, you might need to source this to use RVM files etc, tip from LS chat room | |
source ~/.rvm/scripts/rvm |
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
So agree with @davetron5000 that defects to users are the most important to prevent. | |
I also agree that a test failure doesn't mean a defect occurred as tests themselves | |
often just are bad tests that don't test what they should. While you do have to maintain | |
and think about a test suite, well written tests should be entirely isolated. | |
The app code you do need to reason about the changes of the code effect other pieces of | |
the application. So while a buggy tests might be a bit flaky, if it just passes and I am | |
not specifically working with that test it isn't increasing my thought load while reasoning | |
about the code structure. | |
I still think people should maintain and keep clean tests, and unless you are doing payments, |
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
>> Integer('1001') | |
=> 1001 | |
>> Integer('1001a') | |
ArgumentError: invalid value for Integer: "1001a" | |
from (irb):26:in `Integer' | |
from (irb):26 | |
#note this is very odd, so is '10a100'.to_i | |
>> '1001a'.to_i | |
=> 1001 | |
>> Float('1001.0') |