[ ] a [ ] b
- c
- d
If user is careless, forgetting to put "- " before "[ ]", TODO list could get buggy.
Steps to reproduce bug:
- on parsed MD page of list above, tick "c" to note that "c" is done.
- Now, edit the file.
[ ] a [ ] b
If user is careless, forgetting to put "- " before "[ ]", TODO list could get buggy.
Steps to reproduce bug:
import java.util.HashMap; | |
public class App { | |
private static int installWindowWidth = 500, installWindowHeight = 350; | |
private static int adminWindowWidth = 400, adminWindowHeight = 275; | |
private static String server = "168.28.247.195", port = "3306", database = "software"; | |
private static String user = "root", password = ""; | |
private static String axeServer = "https://168.28.245.221:6467"; | |
private static String webServer = "http://168.28.247.195:3000"; |
class Rack::Logger | |
def initialize(app, logger) | |
@app = app | |
@logger = logger | |
end | |
def call(env) | |
env["rack.logger"] = @logger | |
result = @app.call(env) | |
@logger.flush if @logger.respond_to?(:flush) |
#don't use sinatra/main. we don't want the kitchen sink, just pretty rack apps | |
require 'sinatra/base' | |
class SinatraRailsPlugin < Sinatra::Base | |
get '/foo' do | |
'bar' | |
end | |
#this hackeration is required for sinatra to be a nice rack citizen |
# Rack Nested Params Parser Spec | |
Rack::Utils.parse_query("x[y][z]=10"). | |
should.equal "x" => {"y" => {"z" => "10"}} | |
Rack::Utils.parse_query("x[y][z][]=10"). | |
should.equal "x" => {"y" => {"z" => ["10"]}} | |
Rack::Utils.parse_query("x[y][z][]=10&x[y][z][]=5"). | |
should.equal "x" => {"y" => {"z" => ["10", "5"]}} | |
Rack::Utils.parse_query("x[y][][z]=10"). | |
should.equal "x" => {"y" => [{"z" => "10"}]} | |
Rack::Utils.parse_query("x[y][][z]=10&x[y][][w]=10"). |
class ActionController::Request # ActionController::AbstractRequest in Rails < 2.3 | |
# Returns true if the request seems to come from a bot | |
def bot? | |
user_agent =~ /\b(Baidu|Gigabot|Googlebot|libwww-perl|lwp-trivial|msnbot|SiteUptime|Slurp|WordPress|ZIBB|ZyBorg)\b/i | |
end | |
end | |
# | |
# Then in your controllers you can do : | |
# |
#!/usr/bin/osascript | |
on run_command(command) | |
tell application "Terminal" | |
do script "clear" in selected tab of front window | |
do script command in selected tab of front window | |
end tell | |
end run_command | |
tell application "System Events" | |
my run_command("cd ~/Projects/nudge") |
Surround a heredoc with quotes and you can continue the code on the same line: | |
render :status => 404, :text => <<-'EOH' and return unless setup | |
article not found<br/> | |
I, as a server, have failed<br/> | |
https? | |
EOH | |
Quotes also give you more freedom/creativity with the terminal ID: |
on run argv | |
tell application "System Events" to tell process "Terminal" to keystroke "t" using command down -- open a new tab | |
tell application "Terminal" to do script "cd " & item 1 of argv in front window -- change directory | |
end run | |
-- in your profile | |
-- alias newtab='osascript ~/.applescripts/newtab.applescript `pwd`' |
require 'rubygems' | |
require 'pp' | |
unless self.class.const_defined? "IRB_RC_HAS_LOADED" | |
# Log to STDOUT if in Rails | |
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER') | |
require 'logger' | |
RAILS_DEFAULT_LOGGER = Logger.new(STDOUT) | |
end |