Skip to content

Instantly share code, notes, and snippets.

View davetron5000's full-sized avatar

David Copeland davetron5000

View GitHub Profile
@davetron5000
davetron5000 / preserve-grease.patch
Last active December 19, 2015 08:59
Corrected a glaring error in baconemethod.com
diff --git a/index.html b/index-updated.html
index c655361..bf50077 100644
--- a/index.html
+++ b/index-updated.html
@@ -66,7 +66,9 @@
<p id="notes"><strong>Notes:</strong> You don't need to cover the pan, it
won't really splatter. You can line the pan with aluminum for easier cleanup
if you don't mind consuming aluminum. I do, so after I remove the bacon,
-I'll put a paper towel into the pan, which makes cleanup much easier. I
+I'll put a paper towel into the pan, which makes cleanup much easier, but also soaks
class MyClass
constructor: (options) ->
@options = options
start_polling: ->
# do whatever you need to here
window.StitchFix.controllers.shipments =
labels: -> new MyClass().start_polling()
module Console
def disable_ar_logging
ActiveRecord::Base.logger = nil
end
def enable_ar_logging
ActiveRecord::Base.logger = ::Logger.new(STDOUT)
end
end
include Console
if ! exists("g:project_root")
let g:project_root=getcwd()
endif
" If we are in a 'project', set up a few convieniences, such as searching
" and CommandT to know about the current project dir
if exists("g:project_root")
exec "map g :Ag " . g:project_root . "<Home><Right><Right><Right>"
exec "map  :Ag <cword> " . g:project_root
exec "map G :Ag <cword> " . g:project_root . "
@davetron5000
davetron5000 / query.md
Created April 11, 2013 12:22
KDP seems author-unfriendly

Subject: How can I control if my book is made available below the list price?

For the sake of this question assume that I am selling my book on my own via my personal website and also through Kindle Direct Publishing. Further suppose that I've set the list price the same everywhere. So, we have exactly two channels - my website and KDP.

Assuming that no new channels are added, and assuming I never change the price of the book on my personal website, will that ensure the price via KDP will also stay the same?

In other words, can amazon arbitrarily change the price of my book, or must this be done as a response to marketing in other, non-Amazon-related channels?

While we would like to guarantee your list price would not change in this scenario, our KDP Terms and Conditions state we retain discretion to determine our retail prices.

@davetron5000
davetron5000 / js_libs.rake
Last active December 15, 2015 22:59
A basic task for updating js libs in a rails project
namespace :js do
desc 'Update JS libs configured here'
task :update do
{
'jasmine-jquery' => {
:source => 'https://raw.github.com/velesin/jasmine-jquery/master/lib/jasmine-jquery.js',
:destination => File.join(Rails.root,'spec','javascripts','helpers')
}
}.each do |library,metadata|
puts "Updating #{library}"
___________
| Style |
|---------|
|+desc |
|_________|
^
|
_____|_____
| SKU |
|---------|
Usage:
jira (-a|--action) <action> [(-f|--file) <file>] [--encoding <encoding>] [--debug] [-v|--verbose] [--quiet] [--outputFormat
<outputFormat>] [--connectionTimeout <connectionTimeout>] [--sql <sql>] [--driver <driver>] [--url <url>] [--host <host>] [--port
<port>] [--database <database>] [--dbUser <dbUser>] [--dbPassword <dbPassword>] [--propertyFile <propertyFile>] [--common <common>]
[--findReplace <findReplace>] [--findReplaceRegex <findReplaceRegex>] [--list <list>] [--continue] [--simulate] (-s|--server)
<server> (-u|--user) <user> (-p|--password) <password> [--login <login>] [--service <service>] [-l|--loginFromStandardInput]
[--project <project>] [--toProject <toProject>] [--name <name>] [--description <description>] [--lead <lead>] [--defaultAssignee
<defaultAssignee>] [--after <after>] [--issue <issue>] [--toIssue <toIssue>] [--parent <parent>] [--summary <summary>] [--priority
@davetron5000
davetron5000 / 1_Person.scala
Last active December 12, 2015 08:08
Code to print out if a person can drink in the US, or an acceptable error message
// a person whose attribute are all optional
case class Person(name:Option[String], age:Option[Int])
class EnergyAnalyzer
MIN = 10
MAX = 10000
def initialize(data_points)
@data_points = data_points
end
def filter_outliers
@data_points.reject { |point| point.value < MIN || point.value > MAX }